Page 1 of 1

How to rotate an object around two axis?

Posted: Thu Jun 13, 2013 10:05 am
by rappet
Hi Paul,

I am trying to rotate an object around two axis.
This eaxample in OR standalone shows a chair leaning on two chair legs.
Another example could be an airplane taking off :D

I needed two placement nodes to position the chair the way I wanted.
Trying to do that with just one node it is rotated uncontrolled around the axes (you can see that in the most below image using the plugin).

How can we make this happen in the plugin easily :?:
I can try and use the scatter by making a csv file, but that is going to be work for professors I guess :oops:


greetings, Jeroen

Re: How to rotate an object around two axis?

Posted: Thu Jun 13, 2013 11:24 am
by face_off
The forum eat my very long reply to this. In summary, OR uses XYZ axis ordering, so if you need to rotate the chair in the Y axis before tilting it, it will require either some quaternion maths, or playing with the sliders until you get it done. Every chair angle is possible with the 3 sliders, but some angles are more difficult than others. Keep in mind that Z will ALWAYS be spin (yaw). Something like XYZ 322, 38, 33 shows how is can be done - but not easy to get right.

Re: How to rotate an object around two axis?

Posted: Thu Jun 13, 2013 12:04 pm
by rappet
face_off wrote:The forum eat my very long reply to this. In summary, OR uses XYZ axis ordering, so if you need to rotate the chair in the Y axis before tilting it, it will require either some quaternion maths, or playing with the sliders until you get it done. Every chair angle is possible with the 3 sliders, but some angles are more difficult than others. Keep in mind that Z will ALWAYS be spin (yaw). Something like XYZ 322, 38, 33 shows how is can be done - but not easy to get right.
Hi Paul,

I have made myself an excel sheet being able to make csv files for making rows/matrices,
but only for position on groundfloor, a vertical placement and rotation around the y-axis.
Tapperworks-report-130613-108.jpg
This should be enough for most scenes. But not for this simple tilting chair :(
Ain't there a wizkid out there that has the total formule for that (rotating around different axis at the same time) :?:

btw: I used your numbers and that worked.. did you use a little thinking mathematically or just trial-and-error to get the numbers?
Tapperworks-report-130613-109.jpg
greetings, Jeroen

Re: How to rotate an object around two axis?

Posted: Thu Jun 13, 2013 9:36 pm
by roeland
There is a rotation node which has pitch, yaw and roll angles as input. You can select this type instead of the transform or scale types in transform inputs on placement nodes.

--
Roeland

Re: How to rotate an object around two axis?

Posted: Thu Jun 13, 2013 10:45 pm
by face_off
There is a rotation node which has pitch, yaw and roll angles as input. You can select this type instead of the transform or scale types in transform inputs on placement nodes.
The plugin is using the rotation node Roeland. The issue is the rotation axis order.
btw: I used your numbers and that worked.. did you use a little thinking mathematically or just trial-and-error to get the numbers?
I used trial and error. The trick is the use X and Y axis to get your chair pointing the right direction and tilted, then fix up the spin (row) with the Z axis. Octane is rotating the proxy in the XYZ axis order, and you want YXZ for your chair. The maths behind this is complex (I had to convert between axis orders for PoserPhysics) - http://forum.onlineconversion.com/showthread.php?t=5408.

Paul

Re: How to rotate an object around two axis?

Posted: Fri Jun 14, 2013 3:28 am
by roeland
Ah I was referring to the situation in the Standalone version. There are three node types available for transform inputs:
  • rotation: has 1 float3 input (rotation)
  • scale: has 1 float3 input (scale)
  • transform: has 3 float3 inputs (scale, rotation, translation)
The rotation works differently in the rotation and transform nodes: in transform nodes they use XYZ axis order, in the rotation nodes YXY order (if you create a rotation node the three channels are labeled properly as pitch, yaw and roll).

--
Roeland

Re: How to rotate an object around two axis?

Posted: Fri Jun 21, 2013 2:52 am
by roeland
I think the normal flow is editing the geometry using the host application and then rendering the geometry with the plugin. So the chair should be added / imported and positioned properly through the UI of the host application before rendering. Do you have a particular reason for adding extra objects with the plugin itself?

--
Roeland

Re: How to rotate an object around two axis?

Posted: Fri Jun 21, 2013 7:18 am
by rappet
roeland wrote:I think the normal flow is editing the geometry using the host application and then rendering the geometry with the plugin. So the chair should be added / imported and positioned properly through the UI of the host application before rendering. Do you have a particular reason for adding extra objects with the plugin itself?

--
Roeland
Hi Roeland,
One eason is wanting to use external OBJ objects by linking them with proxy.
By my knowledge I cannot import an OBJ directly to Archicad.
Another reason could be scattering objects (needs to be a proxy).
Greetz,

Re: How to rotate an object around two axis?

Posted: Fri Jun 21, 2013 7:39 am
by face_off
Roeland, as Jeroen mentions - the issue is not with ArchiCAD scene items - it's with OBJ imported at rendertime. In this situation Octane loads the OBJ and then it is connected to rotation transform, which is plugged into the scatter node. The rotation transform is in XYZ axis order, so getting certain angles/rotations (via the user slider controls in the plugin) can be very difficult....and evfen more difficult when the loaded OBJ has to be rotated 90 degrees in the X and 180 degrees in the Y axis just to get the upright (which is the situation with XFrog props).

Paul