O'Reilly logo

Learning Game Physics with Bullet Physics and OpenGL by Chris Dickinson

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

Let there be light!

At this stage, we can see our box, but all of its faces have exactly the same coloring, which makes it a little difficult to determine the exact shape as it moves around in space. OpenGL has some basic built-in lighting functionality, which we will make use of.

Normals

Normals represent the direction pointing away from a given surface or point. They are used in a variety of useful techniques (and not just lighting!), and the most basic of which is simple diffuse lighting or lighting an object based on the angle between the light source and the surface. Our lighting system will use each point's normal to decide in which direction the incoming light should reflect away from that surface helping it calculate the overall color of ...

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