Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SceneKit Transformation ScnMatrix4

Tags:

scenekit

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 :(

like image 266
user3694446 Avatar asked Aug 17 '14 13:08

user3694446


1 Answers

the Core Animation programming guide explains this briefly:

https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/CoreAnimation_guide/CoreAnimationBasics/CoreAnimationBasics.html#//apple_ref/doc/uid/TP40004514-CH2-SW18

In the case of complex transforms it's not always possible to extract the position/rotation/scale information directly from the coefficients though.

like image 144
mnuages Avatar answered Sep 29 '22 11:09

mnuages