Home Documentation Download Screenshots Developper

QGLViewer - Manipulated frame

Presentation

A manipulated frame is a local coordinate system that can be freely moved in the 3D scene using the mouse. QGLViewer handles the mouse motion to frame coordinate conversion. You can then use this frame to move an object or a point in the scene. Combined with the object selection (see the select example) and a dynamic update of the scene properties, the manipulated frame introduces a great reactivity in your applications.

The best way to understand how to use a manipulated frame is to read the manipulatedFrame example.

luxo is a more complex example which combines object selection and several manipulated frames organized in a hierarchy.

Just like the camera (which actually is also attached to a manipulated frame), you can make your manipulated frame spin if you release the mouse button while moving quickly enough. The spinning will stop if you set an other manipulatedFrame. The viewer will automatically connect the manipulatedFrame timer with updateGL when you use setManipulatedFrame().

Advanced functionnalities

A manipulated frame is an overloaded instance of the Frame class. The powerfull coordinate system transformation functions of the Frame class can hence be applied to a manipulated frame.

A QGLViewer can handle at most one manipulated frame at a time. If you want to move several objects in the scene, you simply have to keep a list of the different manipulated frames, and to activate the right one, for instance according to an object selection (see luxo).

When manipulated, the manipulated frame emits a modified signal. This signal is automatically connected to the viewer's updateGL() function when you use QGLViewer::setManipulatedFrame(), so that the display is updated when the frame is moved. If several viewers display the same scene, you should connect this signal to all the other viewers (or setManipulatedFrame() of each viewer).

When manipulated, the isManipulated() function returns true, and it might be checked for a specific action. This is how the fastDraw() function (transparently) works (see the fastDraw example).

Valid XHTML 1.0! Valid CSS! Last modified on jeudi, janvier 16 2003.