wandersonp Posted September 16, 2014 Share Posted September 16, 2014 Im trying to rotate a vector by quaternion but in houdini i got a weird angle What I´m doing wrong? GA_RWHandleV3 myNormal(gdp, GA_ATTRIB_POINT, "N"); GA_FOR_ALL_PTOFF(gdp, ptoff) { xform.identity(); xform.translate(0, 1, 0); newpos = ph.get(ptoff) * xform; quatRot.identity(); quatRot.assign(1.0, 0.0, 0.0, 0.125); // I think 0.125 mean 45º degree quatRot.normalize(); myNormal.set(ptoff, quatRot.rotate(UT_Vector3(1, 0, 0))); ph.set(ptoff, quatRot.rotate(newpos)); } Quote Link to comment Share on other sites More sharing options...
wandersonp Posted September 17, 2014 Author Share Posted September 17, 2014 I made a mistake the first parameter in Quaternion construction is the angle and the last 3 are the vector. UTQuaternion vector(angle, x, y, z); and works. 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.