.NET

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

Why there is no Rotate and Rotate3d method in .NET

138 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 (138 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 (138 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 (138 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
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!