core animation CATransform3D is a 4x4 matrix ?

Discussion in 'Mac Programming' started by MrFusion, Sep 4, 2009.

  1. MrFusion macrumors 6502a

    Joined:
    Jun 8, 2005
    Location:
    West-Europe
    #1
    Hello

    I am messing around with core animation. The documentation says that CATransform3D is a 4x4 matrix, but doesn't really go into detail. Why is Apple using a 4x4 matrix, instead of a 3x3? I assume that Apple is not applying general relativity (Minkowski space is 4x4, with the fourth dimension time).

    What is the 4th dimension here?

    Thanks.
     
  2. chown33 macrumors 604

    Joined:
    Aug 9, 2009
    #2
    There isn't a 4th dimension, at least not in the Minkowski sense. A 3x3 matrix is needed for 2D graphics transforms, so a 4x4 matrix is needed for 3D transforms.

    The key terms are "affine transformation" and "homogeneous coordinates".

    http://en.wikipedia.org/wiki/Transformation_matrix#Affine_transformations

    If you want to understand the math, consult any comprehensive computer graphics textbook, e.g, Foley & van Dam.
     
  3. MrFusion thread starter macrumors 6502a

    Joined:
    Jun 8, 2005
    Location:
    West-Europe
    #3

Share This Page