Chapter 2. OpenGL Primitives and 2D Data Visualization

In this chapter, we will cover the following topics:

  • OpenGL primitives
  • Creating a 2D plot using primitives
  • Real-time visualization of time series
  • 2D visualization of 3D/4D datasets

Introduction

In the previous chapter, we provided a sample code to render a triangle on the screen using OpenGL and the GLFW library. In this chapter, we will focus on the use of OpenGL primitives, such as points, lines, and triangles, to enable the basic 2D visualization of data, including time series such as an electrocardiogram (ECG). We will begin with an introduction to each primitive, along with sample code to allow readers to experiment with the OpenGL primitives with a minimal learning curve.

One can think of ...

Get OpenGL Data Visualization Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.