jonathantopf Posted February 27, 2014 Share Posted February 27, 2014 Hi there, I'm a new huodini user learning on the job after years using maya and this is my first odforce post after much reading. I'm writing a very simple point wrangle node and the last step of the program involves turning a 0-1 rotation value representig a 360 rotation value in the Y axis into a per point orient value that a copy sop can then use to istantiate geometry with the correct orientation. My problem is in converting these values, my first attempt was this f@pi = 3.14159; @orient = set( 0, (2 * @pi) * @y_rot, 0 ); I do get an orient value in the correct axis but not what i was expecting and is clearly wrong. Can anybody shed some light on how to construct a simple @orient value from a simple xyz rotation Thanks! Quote Link to comment Share on other sites More sharing options...
rafaelfs Posted February 27, 2014 Share Posted February 27, 2014 (edited) I believe orient is a vector pointing to a direction, not an array of Euler rotational values... I could be wrong though! Try this code: float y_rot = 0; y_rot = radians(random(@ptnum)*360); vector axis = set(0, 1, 0); vector4 Q = quaternion(y_rot, axis); p@rot = set(Q); rotation_and_copy.hip Edited February 27, 2014 by rafaelfs Quote Link to comment Share on other sites More sharing options...
jonathantopf Posted February 28, 2014 Author Share Posted February 28, 2014 Thats perfect thankyou, I was hoping that there was a simple way like this! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.