I have a car model that I want to draw that consist of two parts, the body and the tires. Each one is a separate model in separate *.OBJ file and each is drawn using separate drawcall.
The initial drawing looks ok, everything seems to be lined up:
However, when i start rotating, everything breaks:
Each object is transformed in the same manner (using XNAMath's translation, scale and rotation matrix) and each object has it's own position in a World space.
I think that the issue here is the "anchor points" of the rotation.
- How can I rotate an object around "anchor point"?
- Which "anchor point" should be used?
- Would it be enough to use common "anchor point" for both objects?
And a side question, do you guys know what would be a proper way to represent such structures? For now those are two separate instances, but if I would like to add interiors, mirrors, etc., the it would properly be better to make some container class with common properties for all objects, right?