Chapter 4. OpenGL Implementation

In this chapter, we will cover the following recipes:

  • Setting up OpenGL in Qt
  • Hello World!
  • Rendering 2D shapes
  • Rendering 3D shapes
  • Texturing in OpenGL
  • Lighting and texture filter in OpenGL
  • Moving an object using keyboard controls
  • 3D Canvas in QML

Introduction

In this chapter, we will learn how to use Open Graphics Library (OpenGL), a powerful rendering Application Program Interface (API), and combine it with Qt. OpenGL is a cross-language, cross platform API for drawing 2D and 3D graphics on screen through the Graphics Processing Unit (GPU) within our computer's graphics chip. In this chapter, we will be learning OpenGL 2.x instead of 3.x, because the fixed-function pipeline is easier for beginners to grasp compared to the newer programmable pipeline. Qt supports both versions, so there should be no problem switching over to OpenGL 3.x and above once you have learned the basic concepts of OpenGL rendering.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.143.205.136