Matrices by example
I''m completely confused by matrices. I see how they work, but I can''t see how this is going to do stuff I want. Anyone know of an article that teaches matrices, not just assumes you know them? All the ones I''ve seen here confuse me by not explaining the whole lot with diagrams and examples of how it works.
Thanks,
David
Let me put this a different way. Lets say I want a cube, rotating on several axises. Using quaternions to prevent gimbal lock, could I use matrices to easily rotating the cube? Thanks,
David
David
This matrix will solve all your problems, I use it INSTEAD OF quaternions.
Have fun!
[edited by - lode on November 17, 2002 6:30:55 AM]
///////////////////////////////////////////////////////Rotate vector v around arbitrary axis l for a radians///////////////////////////////////////////////////////// [tx²+c txy+sz txz-sy 0]// R = [txy-sz ty²+c tyz+sx 0]// [txz+sy tyz-sx tz²+c 0]// [0 0 0 1]//// c = cos(a) // s = sin(a)// t = 1-cos(a)// l = unit vector on rotation axis// a = angle of rotation// (x, y, z) = coordinates of v//// usage: w = R*v//// v = vector to be rotated// w = resulting vector//////////////////////////////////////////////////////
Have fun!
[edited by - lode on November 17, 2002 6:30:55 AM]
Lode, with this technique, you can''t interpolate, and you can''t compose rotations. That''s why it is no replacement for quaternions.
To learn about matrices, try to view them as systems of equations. The only tranformations matrices that are harder to figure out are the rotation matrices, and the projection matrices. Otherwise, by finding the equations
x'' = ax + by + cz + dw
y'' = ...
z'' = ...
w'' = ...
You should see how it works.
Cédric
To learn about matrices, try to view them as systems of equations. The only tranformations matrices that are harder to figure out are the rotation matrices, and the projection matrices. Otherwise, by finding the equations
x'' = ax + by + cz + dw
y'' = ...
z'' = ...
w'' = ...
You should see how it works.
Cédric
quote:
Original post by cedricl
Lode, with this technique, ... you can''t compose rotations.
Maybe I''m misreading your post, but if you''re referring to matrix concatenation, there''s no reason I''m aware of why you can''t do it with the matrix Lode supplied.
You don't need to vote for the "lesser of two evils"! Learn about Instant Runoff Voting, the simple cure for a broken democracy!
quote:
Original post by Zorodius
Maybe I''m misreading your post, but if you''re referring to matrix concatenation, there''s no reason I''m aware of why you can''t do it with the matrix Lode supplied.
That''s what I was referring to... I thought that matrices would be subject to gimbal lock, but it turns out that I didn''t really understand what gimbal lock was (I''m not sure that I do.
Matrices are subject to numerical drifting.
Cédric
quote:
Original post by cedricl
To learn about matrices, try to view them as systems of equations. The only tranformations matrices that are harder to figure out are the rotation matrices, and the projection matrices. Otherwise, by finding the equations
Matrices themselves aren''t the part I''m having trouble with. It''s the application of them that''s what I''m having difficulty understanding. Like I read a tutorial:
This is a rotation matrix. blah blah blah.
Yes okay, but how do you use that? That''s what I''m having trouble with. Like how do I put the coordinates of a point in a matrix, then use that to rotate, etc. Thanks,
David
A coord is represented as a 3-tuple- [x y z]
Multiply the 3-tuple by a 3x3 matrix and you will come up with another 3-tuple, the transformed point.
Check out this article; its rather comprehensive.
http://www.cs.ualberta.ca/~andreas/math/matrfaq_latest.html
Bugle4d
Multiply the 3-tuple by a 3x3 matrix and you will come up with another 3-tuple, the transformed point.
Check out this article; its rather comprehensive.
http://www.cs.ualberta.ca/~andreas/math/matrfaq_latest.html
Bugle4d
~V'lionBugle4d
Yes, a point can be represented as a 1x4 matrix. To transform the point, multiply it by the transformation matrix.
You should also read about homogeneous coordinates.
Cédric
You should also read about homogeneous coordinates.
Cédric
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement