.NET

Reply
Distinguished Contributor
wesbird
Posts: 349
Registered: ‎12-05-2003
Message 1 of 4 (130 Views)

Why there is no Rotate and Rotate3d method in .NET

130 Views, 3 Replies
03-28-2006 12:21 PM
Hi
I found Rotate and Rotate3d both exist in VBA (ActiveX) and ObjectARX, but not in .NET?
Do I miss something in .NET?
How I rotate in 3d without COM Interop?



Thank you
Wes
Distinguished Contributor
jbooth
Posts: 223
Registered: ‎02-17-2006
Message 2 of 4 (130 Views)

Re: Why there is no Rotate and Rotate3d method in .NET

03-28-2006 01:16 PM in reply to: wesbird
This is just a guess, but can't you create a rotation matrix and multiply it through?

Dim m As Matrix3d = Matrix3d.Rotation(angle, rotationVector, centrePoint)
For Each ent As Entity In objectsToRotate
ent.TransformBy(m)
Next ent

The reason they don't add the functionality is probably because you can do it easily enough yourself, (but only if you understand euclidean mathematics I guess).
*Nemorarius
Message 3 of 4 (130 Views)

Re: Why there is no Rotate and Rotate3d method in .NET

03-28-2006 09:15 PM in reply to: wesbird
This way, it's not necessary for them to add anything at all, since you can
do everything yourself.
Why not write your own operating system and pay for it in the bargain?

wrote in message news:5124556@discussion.autodesk.com...
This is just a guess, but can't you create a rotation matrix and multiply it
through?

Dim m As Matrix3d = Matrix3d.Rotation(angle, rotationVector, centrePoint)
For Each ent As Entity In objectsToRotate
ent.TransformBy(m)
Next ent

The reason they don't add the functionality is probably because you can do
it easily enough yourself, (but only if you understand euclidean mathematics
I guess).
Distinguished Contributor
ChrisArps
Posts: 311
Registered: ‎07-29-2004
Message 4 of 4 (130 Views)

Re: Why there is no Rotate and Rotate3d method in .NET

03-29-2006 06:10 AM in reply to: wesbird
Those have kinda been moved to the Matrix2d and Matrix3d classes. If you need to construct scaling/rotation/etc, you do that with the matrix then apply to the entities ecs.

Example : There is no "Move" method, but this shows how to do it.

Dim fromPt As Point3d
Dim toPt As Point3d
Dim ptRes As PromptPointResult

ptRes = editor.GetPoint("Pick a from point")
If ptRes.Status <> PromptStatus.OK Then Return
fromPt = ptRes.Value

ptRes = editor.GetPoint("Pick a to point")
If ptRes.Status <> PromptStatus.OK Then Return
toPt = ptRes.Value

Dim moveVec As New Vector3d(toPt.X - fromPt.X, toPt.Y - fromPt.Y, toPt.Z - fromPt.Z)
Dim moveMat As Matrix3d = Matrix3d.Displacement(moveVec)
ent.TransformBy(ent.Ecs.PostMultiplyBy(moveMat))


Chris Arps

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community