We get it. We use ad blockers too. But GameDev.net displays them so we can continue to be a great platform for you.
Please whitelist GameDev.net and our advertisers.
Also consider a GDNet+ Pro subscription to remove all ads from GameDev.net.
Subscribe to GameDev.net's newsletters to receive the latest updates and exclusive content.
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.
Posted 01 August 2009 - 12:52 PM
Posted 01 August 2009 - 04:26 PM
Posted 01 August 2009 - 04:54 PM
Posted 01 August 2009 - 05:57 PM
Posted 02 August 2009 - 03:39 AM
Quote:Just to try and prevent any confusion on the OP's part, I'll go ahead and point out that this isn't actually what the term 'row major' means. 'Row major' refers to how the matrix is stored in memory; whether the basis vectors of the transform are stored in the rows or columns of the matrix is a separate issue.
In this example, I'm going to be row-major, you may have to transpose for your application.
You can consider the first three rows of your matrix to be the relative X, Y, and Z axes of an object transformed by your matrix. The fourth row is the position of the center of that object. (In all cases, the fourth column is probably [0,0,0,1]).
Posted 02 August 2009 - 06:10 AM
Posted 02 August 2009 - 06:20 AM
Quote:For both a row-major 3x3 matrix with row vectors or a column-major 3x3 matrix with column vectors, the elements of the basis vectors would map to the elements of a 1-d array just as you've shown above.
X: m[0], m[1], m[2]
Y: m[3], m[4], m[5]
Z: m[6], m[7], m[8]
Posted 02 August 2009 - 09:01 AM
Posted 30 March 2011 - 01:11 AM
I have the same problem. Is there any way to invert one axis directly from the rotation matrix? I can't find anything that can help me. Any other method to do it?I've confirmed that it's column-major with column vectors, however for some reason I can't get it to work.
Let's say I want to flip the rotation about the Z axis. So I multiply indices 8, 9, and 10 (4x4 matrix) by -1. However, instead of the rotation being flipped (so moving the gyro to the right makes it go to the right), the geometry is flipped. So now a line drawn from 0 to 10 in the Z now looks like it is going from 0 to -10?
I'll try to keep this in the math/physics category, but perhaps I have a bigger OpenGL problem in addition to the matrix stuff...
Thanks.
Posted 30 March 2011 - 02:15 AM
[ c s 0 ] [ -s c 0 ] [ 0 0 1 ](where c means cos(angle) and s means sin(angle)) is a simple, z-axis rotation matrix.
Posted 30 March 2011 - 05:15 AM
Edited by Buckeye, 30 March 2011 - 12:41 PM.
Please don't PM me with questions. Post them in the forums for everyone's benefit, and I can embarrass myself publicly.
You don't forget how to play when you grow old; you grow old when you forget how to play.
Posted 01 April 2011 - 09:52 AM
Ok, I guess I can't do directly from the matrix ... I will try to get euler angles and create a new matrix ...
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.
GameDev.net™, the GameDev.net logo, and GDNet™ are trademarks of GameDev.net, LLC.