Re: undoing rotations and translations
- From: Nicolas Bonneel <Nicolas.Bonneel@xxxxxxxxxxxxxxx>
- Date: Tue, 10 Nov 2009 14:13:12 +0100
Ron Francis a écrit :
Hi,
Please excuse my ignorance about matrices, but I want to know if something
is possible before I delve too much into them.
Basically, I'm rotating vertices around a point in space and an arbitrary
axis, or translating those points.
Currently, I'm performing all the actions in sequence rather than compiling
them into a matrix.
So the question is, is it possible to perform rotations or translations
several times and each time add the current matrix to the previous one so
that I can use one matrix to return the vertices to their original
positions?
you will have to use homogenous coordinates. You basically add a one to your (x,y,z) vector (so it becomes (x,y,z,1)), and use a 4x4 matrix for your transformations.
Now, a rotation matrix is written as a usual rotation matrix + one row and one column with (0,0,1). And a translation matrix is written as the identity matrix + one row and one column. The column is the vector of the translation + a one at the end.
To get the original point back, just inverse the matrix (which can be done with transposes and minus operations if you only have rotations and translations).
Google for homogenous coordinates, it will be better explained ;)
--
Nicolas Bonneel
http://www-sop.inria.fr/reves/Nicolas.Bonneel/
.
- Follow-Ups:
- Re: undoing rotations and translations
- From: Ron Francis
- Re: undoing rotations and translations
- References:
- undoing rotations and translations
- From: Ron Francis
- undoing rotations and translations
- Prev by Date: undoing rotations and translations
- Next by Date: Re: undoing rotations and translations
- Previous by thread: undoing rotations and translations
- Next by thread: Re: undoing rotations and translations
- Index(es):
Relevant Pages
|