/**************************************************************************** Copyright (C) 2002-2006 Gilles Debunne (Gilles.Debunne@imag.fr) This file is part of the QGLViewer library. Version 2.2.4-1, released on December 12, 2006. http://artis.imag.fr/Members/Gilles.Debunne/QGLViewer libQGLViewer is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. libQGLViewer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with libQGLViewer; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *****************************************************************************/ #include "manipulatedFrame.h" #include using namespace qglviewer; using namespace std; static void drawSpiral() { const float nbSteps = 200.0; glBegin(GL_QUAD_STRIP); for (float i=0; imatrix()); // Scale down the drawings glScalef(0.3, 0.3, 0.3); // Draw an axis using the QGLViewer static function drawAxis(); // Draws a frame-related spiral. drawSpiral(); // Restore the original (world) coordinate system glPopMatrix(); } QString Viewer::helpString() const { QString text("

M a n i p u l a t e d F r a m e

"); text += "A ManipulatedFrame converts mouse gestures into Frame displacements. "; text += "In this example, such an object defines the position of the spiral that can hence be manipulated.

"; text += "Adding two lines of code will then allow you to move the objects of "; text += "your scene using the mouse. The button bindings of the ManipulatedFrame "; text += "are the same than for the camera. Spinning is possible.

"; text += "Default key bindings have been changed in this example : press Control "; text += "while moving the mouse to move the camera instead of the ManipulatedFrame."; return text; }