3D transforms simply explained - m34 is key

This is mostly a note for an iOS development environment.

  • M_PI is half the diameter, so M_PI * 2 (6.28) is full circle (in radians). Zero would be no rotation, which would also yield the same effect as M_PI * 2, because it is rotating twice.
  • M_PI would yield a half rotation.
  • Negative values (for the m34 or radians) rotate towards 6.28 or zero (orthographic) counter-clock-wise. If both values are negative (or positive), then it will rotate clock-wise.
  • Changing m34 adds to the effect of (or enhances) the rotations.
  • The transform.m34 value will always be a percentage of 1.0 (flat). Hence dividing 1 by N (1.0f / 1200). 1.f represents "full perspective", but looks huge to the user because its the full size. Closer to 1, the flatter the look, but the larger the view. Think of a train track. 1 would be like viewing the tracks from the top, flat. But, as you reduce/divide 1 by something, you change one of the ends of the track to be more triangular. Negative or positive focuses one of the ends to a point.
  • The m34 value must be a float, so make sure you divide by a float, not two integers.
    • Example: NO = (1 / 1200); YES = (1.0 / 1200)
  • Perspective (m34) changes have dramatic effects on the transform, so small fractions do a lot. 
    • Example: 1.0 / 1200 = 0.00083, a small fraction that yields a huge transform change.
  • X will rotate on/across the x-axis (horizontal) of the plane, Y will rotate on/across the y-axis (vertical) of the plane. And Z will rotate around the center of the plane. The value is the percentage/amount of rotation applied to each position, hence the max is 1.


http://en.wikipedia.org/wiki/Orthographic_projection

Comments

Popular posts from this blog

Python SUDS with Windows Authentication (SOAP)

Text Sherlock the OpenGrok alternative (Source Code Search Engine)

How to remove, update, or replace the WKWebView inputAccessoryView