Search code examples
3dgame-enginerotational-matrices

3D Game Engine, Get absolute transform


I have a parent scene node in my engine, and a child. child's transform(position, rotation and scale) is relative to the parent.
Now I want to know the child's absolute transform. I mean the child's relative transform to the main coordinates.
Any ideas?
Edit: The problem is that I don't store matrices in a scene node. I only have 3 vectors. Position, Rotation and Scale.


Solution

  • You need to walk down the tree and multiply each matrix along the way, from the scene root to the final object. The resulting matrix will be the absolute transforms.