Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ObjectARX and rotation

352 views
Skip to first unread message

Christopher Dix

unread,
Apr 6, 1999, 3:00:00 AM4/6/99
to
I am attempting to rotate a set of entities in ObjectARX, and I am having
some difficulties. The code I have written does rotate the entities, but
not at the angle I have indicated. Could someone let me know what I am
doing wrong, or possibly post some sample code to accomplish this?

Thanks,
Christopher Dix
C++ Developer
FMStrategies
c...@fmstrategies.com

// Begin code
AcDbEntity* pEntity = NULL;
AcGeMatrix3d matrix;
AcGePoint3d point;
AcGeVector3d vec(0.0, 0.0, 1.0); // Z-axis

PointerArray aEntities;

// Set the base point
point.set( 2.0, 3.0, 0.0 );

//matrix.setToRotation( dAngle, AcGeVector3d::kZAxis, point );
// I thought this line would build the matrix. I also tried
// AcGeVector3d::kZAxis as the axis vector.
matrix.setToRotation( dAngle, vec, point );

// Assume we fill aEntities with a group of entities here
.
.
.

for ( int nIndex = 0; nIndex < aEntities.Size();
nIndex++)
{
pEntity = (AcDbEntity*)aEntities[nIndex];
pEntity->upgradeOpen();
pEntity->transformBy( matrix );
pEntity->close();
}

// End code

Peter Sylvester

unread,
Apr 7, 1999, 3:00:00 AM4/7/99
to
Hi,

The angle has to be given in Radian.
Hope this helps.

Peter

Christopher Dix wrote in message <7ed6d8$pe...@adesknews2.autodesk.com>...

0 new messages