OpenGL Discussion and Help Forums - Math and Algorithms
https://www.opengl.org/discussion_boards/
Discussion about 3D math and linear algebra that is essential as a background to OpenGL codingenSun, 23 Jul 2017 04:30:26 GMTvBulletin60https://www.opengl.org/discussion_boards/images/misc/rss.pngOpenGL Discussion and Help Forums - Math and Algorithms
https://www.opengl.org/discussion_boards/
Rotate a vector to align with another vector(but keep the same up direction)
https://www.opengl.org/discussion_boards/showthread.php/199822-Rotate-a-vector-to-align-with-another-vector%28but-keep-the-same-up-direction%29?goto=newpost
Thu, 20 Jul 2017 15:06:28 GMTI've been trying to find the best way to calculate the rotation that would align vector A with vector B. I have found solutions but in my case I need the relative up direction to be preserved. Therefore I have been trying to accomplish this with just 2 rotations. First on the Y axis to align the vectors relative to Y, then I calculate the angle between them at this point which would give me the X rotation. However, handling these components of rotation separately doesn't produce the desired effect when I apply both rotations. Applying the Y rotation to the vector turns it perfectly to line up with vector B. But when I apply X rotation, it doesn't rotate properly. I know this is most likely because the X rotation is being applied along the regular X axis and not the vector's current x axis. Any suggestions would be awesome. It's really frustrating me
]]>Math and AlgorithmsLeroy1981https://www.opengl.org/discussion_boards/showthread.php/199822-Rotate-a-vector-to-align-with-another-vector%28but-keep-the-same-up-direction%29A Simple Example of Projection Matrix
https://www.opengl.org/discussion_boards/showthread.php/199808-A-Simple-Example-of-Projection-Matrix?goto=newpost
Sun, 16 Jul 2017 19:27:21 GMTI'm am aware of how a Orthographic projection matrix is calculated using the arguments passed to the glOrtho() method.
I just wanted to see a working example and a diagram to explain the effect of multiplying a vector with this matrix.
]]>Math and Algorithmsjitendra2896https://www.opengl.org/discussion_boards/showthread.php/199808-A-Simple-Example-of-Projection-MatrixCould someone please explain post/pre multiplication of matrices?
https://www.opengl.org/discussion_boards/showthread.php/199782-Could-someone-please-explain-post-pre-multiplication-of-matrices?goto=newpost
Tue, 11 Jul 2017 18:30:02 GMTAfter calling glMultMatrix(m), is m pre or post-multiplied with the current matrix?
i.e.
current_matrix = m * current_matrix
or
...After calling glMultMatrix(m), is m pre or post-multiplied with the current matrix?
i.e.
current_matrix = m * current_matrix
or
current_matrix = current_matrix * m

*** Can you please point me to the paragraph in the OpenGL spec where pre-or-post multiplication is specified?

This is very important when developing a driver. Thank you all for your help!
]]>Math and Algorithmsdlk5730https://www.opengl.org/discussion_boards/showthread.php/199782-Could-someone-please-explain-post-pre-multiplication-of-matrices