DXSDK: How to store the state of the CModelViewerCamera?

Is it possible to store the state of the CModelViewerCamera (DXSDK) to later reload it I didn't manage it. I like to store the rotations that were
made around the model using the mouse. Interestingly the Eye Point doesn't change when rotating, so it seems the object is rotated rather than the camera. This is proofed by the fact that only the cameras world matrix is changing when rotating. But simply saving the world matrix and resetting it with the cameras SetWorldMatrix() method doesn't work.

Can anybody help Thanks.

Nico


Answer this question

DXSDK: How to store the state of the CModelViewerCamera?

  • PaTaKi

    Thanks! Sounds complicated indeed. I hoped I could avoid modifying the camera classes, to avoid having to adjust my code when a new sdk is released.

    Nico

  • SpyKraft

    It is possible, but tricky.  You'll need to store the set of all the matrixs and quaternion's found in the CModelViewerCamera, and its base class CBaseCamera as well as the 2 member CD3DArcBall classes.   I recommend modifing the camera clases to add a copy contstructor that does the copying all of the state.  We'll add this to list of features to add, but I can't say when we'll be able to get to this.

    Thanks,
    Jason

  • DXSDK: How to store the state of the CModelViewerCamera?