View Full Version : how to zoom and rotate he box like this?
East2010
10-08-2011, 01:36 AM
After many zooming and rotating by the user,I want to get the fixed positing of the box by an event,for example,clicking a button.
mikeheck
10-09-2011, 08:16 PM
After many zooming and rotating by the user,I want to get the fixed positing of the box by an event,for example,clicking a button.
I'm not certain I understand the question, but I think you're asking if you can have an event, for example clicking a button in the user interface, set the camera to a specific position and orientation. Well yes, of course. For example:
SoCamera* pCamera = pViewer->getCamera();
pCamera->position = savedPosition;
pCamera->orientation = savedOrientation;
The trick is to know or compute the values for position and orientation. If you want a button that sets up an axis aligned view for example (a common feature), the values are easy. The information in this thread may be useful. In other cases it can be useful to navigate the camera to the desired position and orientation, then open IvTune (normally Shift-F12) and copy the values from the fields of the camera node.
vBulletin® v3.8.7, Copyright ©2000-2012, vBulletin Solutions, Inc.