01-30-2006, 03:21 AM
I have an application where the user can rotate or translate around a model and zoom. This is achieved using glTranslatef glRotatef etc.
I have implemented a reset view button which resets the model view matrix.
I need to add a fit view option which resets any transformations so that the model is in the middle of the viewport but does not affect the rotation of the model.
How would I best achieve this? Is it possible by purely changing the model view matrix? Perhaps I should cahnge my code so that translation is done my moving the camera and therefore I could reset this matrix leaving the one which affects the model.
Thanks in advance,
Rob
I have implemented a reset view button which resets the model view matrix.
I need to add a fit view option which resets any transformations so that the model is in the middle of the viewport but does not affect the rotation of the model.
How would I best achieve this? Is it possible by purely changing the model view matrix? Perhaps I should cahnge my code so that translation is done my moving the camera and therefore I could reset this matrix leaving the one which affects the model.
Thanks in advance,
Rob