Grasshopper

algorithmic modeling for Rhino

Hi all, I am trying to rotate a point but I don't know about the good way to write it
I wrote the following code but it doesn't work


Dim p0 As New Point3d(0, 0, 0)
Dim p1 As New Point3d(10, 10, 10)
Dim v1 As New Vector3d(1, 1, 1)

Dim rotate_xf As New Transform
rotate_xf.rotation((Math.PI / 180) * 90, v1, p0)
p1.Transform(rotate_xf)

can someone advice me what to do ?

thx

Views: 175

Replies to This Discussion

p1.Transform(Transform.Rotation((Math.PI / 180) * 90, v1, p0))

The Transform class has a bunch of static functions that create Transform matrices. So there's no point in making a New Transform(), you should always use Transform.Rotation, Transform.Translation etc.

--
David Rutten
david@mcneel.com
Seattle, WA
Ok thank you david !

RSS

About

Translate

Search

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service