I have a list of RhinoObject and I want to know the orientation (possibly in HPR) of these objects but I can’t find a method to get it. (This list contains Box and Sphere).
Can anyone help me ?
I’m coding in C#.
The position of Rhino object is defined by their geometry, which is represented in world coordinates. That is, Rhino object do not maintain any special kind of orientation system.
Does this help?
thakyou for your answer but not helps me very much. What I want to know is the rotation that the user do on the object in the doc. So I can show it or do something else. Do you have some ideas?
You’ll want to listen for the BeforeTransformObjects event on the Rhino document. When the user executes a transformation command (Move,Rotate,Scale,Mirror) etc, this event is fired before Replace,Add,Delete RhinoObject. If you want to store them, you can cache them in user data and compound them yourself.
A less elegant (but easier to implement) way of doing it would be to take three points on your initial geometry (i.e. for a box these might be corner points 0,1,2) and the same points on your new geometry to perform a PlaneToPlane transform - from there you can ascertain the rotation.
the event BeforeTransformObjects is what I’m looking for!
Thakyou very much!