kimziv / oglsuperbible5

GLTools and OpenGL SuperBible (5th Edition) OpenGL超级宝典第五版
41 stars 16 forks source link

Orthographic and Perspective in Chapter 4 have incorrect normals #44

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Run the Orthographic or Perspective example in Chapter04.
2. Rotate the hollow pipe to see the inner top face.
3. The face is always black irrespective of its angle. The attached photos show 
the issue where the top face is black, as compared to the bottom face.

What is the expected output? What do you see instead?
The inner top face should change color as its angle to the light changes.

What version of the product are you using? On what operating system?
Ubuntu 10.04

Please provide any additional information below.

The normals of the top inside face are specified incorrectly in both the 
programs. The normals specified are

innerBatch.Normal3f(0.0f, 1.0f, 0.0f);

The comment preceding this is also incorrect
// Normal points up Y axis

The normal for the top inner face should point down.

Changing the normals to point down fixes the problem.
// Normal points down Y axis
innerBatch.Normal3f(0.0f, -1.0f, 0.0f);

Original issue reported on code.google.com by nag.ra...@gmail.com on 31 Aug 2012 at 8:02

Attachments: