Reputation: 111
ScnMatrix4 is a 4x4 matrix. My question is what matrix rows correspond to position(ScnVector3), rotation(ScnVector4), scale(ScnVector3). is the 4th row empty ?
Edit: I played around with the SCN4matrix, i needed it to create a shape with multiple stairs.
I needed the info about the matrix for the Shapeswithshapes method
[SCNphysicsShape shapeWithShapes: (ElementArray*) :(transformArray)];
ScnMatrix4= | Xx Xy Xy X|
| Yx Yy Yz Y|
| Zx Zy Zz Z|
| Px Py Pz W|
Xx Xy Xy = The X axis vector of the local coordinate system of the shape.
Yx Yy Yz = The y axis vector of the local coordinate system of the shape.
Zx Zy Zz = The z axis vector of the local coordinate system of the shape.
Px = position in x axis relative to parent;
Py = Position in y axis relative to parent;
Pz = Position in z Axis relative to parent;
X Y Z = read the link for info;
W= 1 define that the matrix is about the position relative to parent;
W= 0 define that the matrix is about orientation;
Basicly a SCNmatriX4 completely describes the position, rotation of a node/shape.
http://www.opengl-tutorial.org/beginners-tutorials/tutorial-3-matrices/
This Link Provides a great source for all the info you need about Matrix Manipulation;
Edit 2; i suck at editing :(
Upvotes: 8
Views: 7802
Reputation: 6278
GLKit has some super helpful math functions for playing with these.
Part of this doc sections says things like:
Discussion
The first three components of column 3 provide the translation values tx, ty and tz.
The Translate functions do the movement. And make it much, much, much easier than doing things manually.
Upvotes: 0
Reputation: 13462
the Core Animation programming guide explains this briefly:
In the case of complex transforms it's not always possible to extract the position/rotation/scale information directly from the coefficients though.
Upvotes: 7