Optimizing hierarchical transform

Posted by Geotarget on Game Development See other posts from Game Development or by Geotarget
Published on 2012-07-10T18:45:23Z Indexed on 2012/07/10 21:25 UTC
Read the original article Hit count: 225

Filed under:
|
|
|
|

I'm transforming objects in 3D space by transforming each vector with the object's 4x4 transform matrix. In order to achieve hierarchical transform, I transform the child by its own matrix, and then the child by the parent matrix. This becomes costly because objects deeper in the display tree have to be transformed by all the parent objects. This is what's happening, in summary:

  • Root -- transform its verts by Root matrix
    • Parent -- transform its verts by Parent, Root matrix
      • Child -- transform its verts by Child, Parent, Root matrix

Is there a faster way to transform vertices to achieve hierarchical transform? What If I first concatenated each transform matrix with the parent matrices, and then transform verts by that final resulting matrix, would that work and wouldn't that be faster?

  • Root -- transform its verts by Root matrix
    • Parent -- concat Parent, Root matrices, transform its verts by Concated matrix
      • Child -- concat Child, Parent, Root matrices, transform its verts by Concated matrix

© Game Development or respective owner

Related posts about 3d

Related posts about math