beeemtee Posted July 17, 2009 Share Posted July 17, 2009 Hi, I would like to ask, that how could I rotate a vector around another vector with VOPs? I want to rotate the up vectors around the normals of points in a VOP SOP. My first attempt was to construct a matrix with the lookat node, then rotate it around N with 'rotate' and then convert it back to a vector (last three floats of the 3x3 matrix). This network doesn't work perfectly and it seems to be a bit complicated comparing to the problem. My understanding of matrices, quaternions and the related part of vex is very shallow (as you probably already found out), but I would like to know and understand more about them, so this is why I'm trying to do it this way and not in SOPs. thanks in advance! bmt Quote Link to comment Share on other sites More sharing options...
anim Posted July 17, 2009 Share Posted July 17, 2009 use rotate VOP to create matrix axis would be normalised N angle would be the angle you want (in radians) plug the matrix to orient VOP "xform" input plug the up vector to orient VOP "from" input output of orient VOP is your rotated up vector around N by angle or you can simply multiply up vector with that matrix, it will rotate it as well Quote Link to comment Share on other sites More sharing options...
sam.h Posted July 17, 2009 Share Posted July 17, 2009 (edited) like so ... you are too fast anim (or google reader is too slow...) rotate_vector.hip Edited July 17, 2009 by sam.h Quote Link to comment Share on other sites More sharing options...
beeemtee Posted July 17, 2009 Author Share Posted July 17, 2009 thanks guys for the quick reply! this makes a lot more sense . the only issue was that I wanted to rotate the ups around the Ns and not the other way around, but the principle is correct, so a quick rewire in your example did the thing. thanks again! bmt Quote Link to comment Share on other sites More sharing options...
hughspeers Posted July 17, 2009 Share Posted July 17, 2009 hello I was wondering if any of you could help me with a similar problem I'm trying to work out in vops I originally posted it in general Houdini questions and although it is to do with sprites I think needs the insight of a modeler. http://forums.odforce.net/index.php?showtopic=9315 I've been scratching my head with it for a few weeks now so any new insights would be well appreciated Quote Link to comment Share on other sites More sharing options...
tutumannyaque Posted October 5, 2016 Share Posted October 5, 2016 On 7/16/2009 at 9:15 PM, sam.h said: like so ... you are too fast anim (or google reader is too slow...) rotate_vector.hip Wow thanks so much! To be completely honest I don't understand how matrices works nor how your setup works but it solved my problem! Quote Link to comment Share on other sites More sharing options...
fragredocroix Posted May 10, 2017 Share Posted May 10, 2017 You can do it without matrices by using a quaternion and a quaternion rotate like so : quaternions are just vector 4 float (axis X, axis Y , axis Z, angle in radians) qrotate_vector.hip 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.