.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Why there is no Rotate and Rotate3d method in .NET

3 REPLIES 3
Reply
Message 1 of 4
wesbird
311 Views, 3 Replies

Why there is no Rotate and Rotate3d method in .NET

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
Windows 10 64 bit, AutoCAD (ACA, Map) 2023
3 REPLIES 3
Message 2 of 4
jbooth
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).
Message 3 of 4
Anonymous
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).
Message 4 of 4
ChrisArps
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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost