|
Base point in acedDragGen
Welcome
I tried using the acedDragGen function. It's not work corretly, because base point is initialized with 0,0,0. This is my code:
void ident_init(ads_matrix id)
{
int i, j;
for (i=0; i<=3; i++)
for (j=0; j<=3; j++)
id[i][j] = 0.0;
for (i=0; i<=3; i++)
id[i][i] = 1.0;
}
int dragsample( ads_point usrpt, ads_matrix matrix )
{
ident_init(matrix); // Initialize to identity.
// Initialize translation vector.
matrix[0][T] = usrpt[X];
matrix[1][T] = usrpt[Y];
matrix[2][T] = usrpt[Z];
return RTNORM; // Matrix was modified.
}
//main function
...
int res = acedGetPoint( NULL, L"\nPick a point: ", p1 );
...
ads_matrix mt;
acedDragGen( ssname, NULL, 0, &dragsample, p2 );
...
How to set base point as p1? Any suggestions?
Etiquetas (0)
Agregar etiquetas
Denunciar
1 RESPUESTA
Ordenar:
MENSAJE 2 DE 2
fsztuczny
Advocate fsztuczny en respuesta a: fsztuczny
09-11-2010 12:50 PM
I found the solution!
ads_point p1;
int dragsample( ads_point usrpt, ads_matrix matrix )
{
ident_init(matrix); // Initialize to identity.
// Initialize translation vector.
matrix[0][T] = usrpt[X] - p1[X];
matrix[1][T] = usrpt[Y] - p1[Y];
matrix[2][T] = usrpt[Z] - p1[Z];
return RTNORM; // Matrix was modified.
}
Base point (p1) must be defined over this function. |
|