O'Reilly logo

OpenGL Data Visualization Cookbook by William C. Y. Lo, Raymond C. H. Lo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Rendering 3D models with points, lines, and triangles

The next step after importing the 3D model is to display the content on the screen using an intuitive and aesthetically pleasing way. Many complex scenes consist of multiple surfaces (meshes) and many vertices. In the previous chapter, we implemented a simple shader program to visualize the point cloud at various depth values based on a heat map. In this section, we will utilize very simple primitives (points, lines, and triangles) with transparency to create skeleton-like rendering effects.

How to do it...

We will continue the implementation of the ObjLoader class to support loading vertices and draw the graphics for each mesh in the scene.

In the source file of ObjLoader.cpp, we add a recursive ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required