TomRaynor Posted March 30, 2014 Share Posted March 30, 2014 I just want to clarify in my head the maths behind what is happening in this vop and was hoping someone could help spell it out. So yeah I get that this vop is used to construct a 3x3 rotation matrix given two incoming vectors. My understanding of how this works generally is as described in this link: http://gamedev.stackexchange.com/questions/20097/how-to-calculate-a-3x3-rotation-matrix-from-2-direction-vectors So cross product the two vectors you have to get a third, and then cross this new orthogonal vector with the first vector to get a completely orthogonal frame. Is this what the lookat vop is doing and if so are the "two location" and "up vector" the two input vectors? What is the from location all about? I am trying to work out how I get a quaternion that represents the coordinate frame of my incoming N and up vectors. I have attached a scene file showing an arrow being copied onto a point which has a z-positive normal and a y-positive up vector. I am plugging the normal into the "to location" and the up vector into the "up vector". I am curious why my coordinate frame (and arrow) is flipping. I'm sure it is really simple and obvious but any more detailed explanation into how this node works and why it is doing what it is doing would be great. Also, any info on quaternions, what they are and how you use them would be great. I use them but feel I don't fully understand them. P.S. The answer: "no one really understands them" I will not accept Thanks. matrixConstruction_v01.hip Quote Link to comment Share on other sites More sharing options...
pezetko Posted March 30, 2014 Share Posted March 30, 2014 Some reading about quaternions:https://developer.gnome.org/cogl/unstable/cogl-Quaternions-%28Rotations%29.htmlAlso see the links to external references on that page:E.g. like this one is nice: http://www.isner.com/tutorials/quatSpells/quaternion_spells_12.htm Quote Link to comment Share on other sites More sharing options...
TomRaynor Posted March 30, 2014 Author Share Posted March 30, 2014 Thanks Petr. Any idea how the look at or align VOPs work other than what is in the help? Quote Link to comment Share on other sites More sharing options...
Guest tar Posted March 30, 2014 Share Posted March 30, 2014 Hey Tom - sounds like you're asking just for the maths side - have you looked into maths courses? Quote Link to comment Share on other sites More sharing options...
TomRaynor Posted March 30, 2014 Author Share Posted March 30, 2014 I am familiar with the maths, manipulating vectors/matrices etc. I'm just trying to work out what the nodes are actually doing in more detail and how to use them. Quote Link to comment Share on other sites More sharing options...
anim Posted March 31, 2014 Share Posted March 31, 2014 lookat() VEX function or VOP node uses from-to vector as negative X axis and up vector as positive Y plane so the flipping is obvious if you assumed that is uses positive Z I think it's made that way to reflect Camera viewing direction (which is negative Z) as well as Object Look At parm orients negative Z in target direction 1 Quote Link to comment Share on other sites More sharing options...
rayman Posted March 31, 2014 Share Posted March 31, 2014 (edited) Math for lookat is really simple. First vector : normalize( to location vector - from location vector ) Second : cross ( First vector , up vector ) Third : cross( First vector , Second vector ) They are probably not ordered this way but the idea is the same.\ For quaternions watch this : http://www.youtube.com/playlist?list=PLW3Zl3wyJwWNWsJIPZrmY19urkYHXOH3N Really nice explaination. Edited March 31, 2014 by rayman 1 Quote Link to comment Share on other sites More sharing options...
TomRaynor Posted March 31, 2014 Author Share Posted March 31, 2014 Perfect, thanks Pavel. That is what I wanted to clarify. Thanks for the video links too. Great stuff! 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.