SlideServe
Menu
Préférences
© SlideServe · v2026

Introduction to C & C++

marvela avatar
20 diapositives · 264 Views · Dec 30, 2012

libQGLViewer is a powerful C++ library that leverages Qt to streamline the development of OpenGL 3D viewers. It provides essential features such as intuitive camera movement, efficient object selection, and customizable camera path control, making it easier to create dynamic 3D environments. Users can also save screenshots and utilize various drawing functions, demos, and customization options to enhance their viewer experience. This presentation delves into practical applications and showcases how libQGLViewer can transform 3D viewer projects, offering flexibility and functionality.

Introduction to C & C++ - slide 1
01 / 20Introduction to C & C++
1 / 17

Télécharger la présentation

Introduction to C & C++
Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation

Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement. Téléchargez la présentation en cliquant sur ce lien. Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.

F I N

Plus de contenu associé

Transcription de la présentation
  1. Introduction to C & C++ Lecture 13 – libQGLViewer JJCAO

  2. libQGLViewer • C++ library • based on Qt • eases the creation of OpenGL 3D viewers with some of the typical 3D viewer functionalities: • move the camera using the mouse • object selection • camera paths control using F1..F12 (demo with simpleViewer) • screenshot saving • …

  3. Without libQGLViewer void MyGLWindow::draw(){ if (!valid())//for window creat and resize initGL(); // clears the color buffer and depth buffer using the current clearing color glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); view_all();// setup camera (only once) //begin of drawing glPushMatrix();//to avoid cumulate effect //setup viewpoint from current arcball arcball_.glDraw(); // draw … … glPopMatrix(); //end of drawing }

  4. Demos • CGAL-3.8\demo\Triangulation_3

  5. simpleViewer D:\libQGLViewer-2.3.10\examples\simpleViewer

  6. manipulatedFrame D:\libQGLViewer-2.3.10\examples\manipulatedFrame

  7. manipulatedFrame setManipulatedFrame(new ManipulatedFrame()) glMultMatrixd(manipulatedFrame()->matrix()); setAxisIsDrawn() drawAxis() D:\libQGLViewer-2.3.10\examples\manipulatedFrame

  8. Select /pick D:\libQGLViewer-2.3.10\examples\select

  9. Select /pick D:\libQGLViewer-2.3.10\examples\select

  10. Select /pick virtual void drawWithNames(); virtual void postSelection(constQPoint& point); glPushName(i); camera()->convertClickToLine(point, orig, dir); selectedPoint = camera()->pointUnderPixel(point, found); selectedName(); D:\libQGLViewer-2.3.10\examples\select

  11. keyboardAndMouse D:\libQGLViewer-2.3.10\examples\keyboardAndMouse

  12. keyboardAndMouse No effect! Why? D:\libQGLViewer-2.3.10\examples\keyboardAndMouse

  13. keyboardAndMouse D:\libQGLViewer-2.3.10\examples\keyboardAndMouse

  14. keyboardAndMouse D:\libQGLViewer-2.3.10\examples\keyboardAndMouse

  15. keyboardAndMouse • setShortcut()changestandard action bindings (axis, grid or fps display, exit...). • setMouseBinding() and setWheelBinding()changestandard action mouse bindings (camera rotation, translation, object selection...). • If you want to define new keyboard shortcuts, overloadkeyPressEvent() and bind your own new actions. Use setKeyDescription() to add your shortcuts in the help window. • To define new mouse actions, overload mouse(Press|Move|Release)Event. OverloadsetMouseBindingDescription() to update the help window binding tab. D:\libQGLViewer-2.3.10\examples\keyboardAndMouse

  16. Animation D:\libQGLViewer-2.3.10\examples\animation

  17. Animation D:\libQGLViewer-2.3.10\examples\animation

  18. Animation • When animation is activated(the Returnkey toggles animation), the animate() and then the draw() functions are called in an infinite loop. • You can tune the frequency of your animation (default is 25Hz) using setAnimationInterval(). The frame rate will then be fixed, provided that your animation loop function is fast enough. D:\libQGLViewer-2.3.10\examples\animation

  19. Interface Practice in the Designer D:\libQGLViewer-2.3.10\examples\interface

  20. More examples