More About Normals
If you want a bit more of an explanation of normals, then this is for you. It started originally as a message in the Rail 3D e-group. For a more general introduction to strips, see gettingstartedwithstrips.
Before we start discussing normals, hopefully you can see the advantage that strips offer over Fill statements in most situations. Normals might seem a bit scary to learn, but it’s well worth the effort when you see the results.
Just to illustrate, consider the following two vertical cylinders:
Both cylinders have eight sides, yet you can see that the one on the left looks significantly more realistic than the one on the right. The left cylinder was created with one strip, and the right cylinder was created using eight Fill statements.
Frame rates are also an important consideration when making models, and strips also offer an advantage over Fills in this aspect. A curved wall of a coach created using Fills instead of strips can potentially have twice as many vertices to draw.
2 Some definitions
A normal is simply a vector that is perpendicular to (at right angles to) a surface. In other words, it’s an arrow that starts on a surface and points directly out of the surface. For a real-life analogy, you could say that a flagpole is normal to the ground, provided the ground is flat and the pole is straight!
For our purposes, a vector is essentially just a mathematical term for an arrow. All arrows have a direction and a length. In the same way, all vectors have a direction and a magnitude. In the flagpole analogy, the direction would be ‘up’ and the magnitude, or length, would be the height of the flagpole, say 10m.
If, for some reason, your flagpole was installed incorrectly so that it went below the ground instead of above it, you can represent this in “vector-speak” in one of two ways. You could just change the direction to ‘down’ (and leave the magnitude as 10), or you could leave the direction as ‘up’ and say the magnitude is now −10m. They both mean the same thing.
3 Normals in Rail 3D
Rail 3D uses normal vectors to decide how to light the panel. When you make a strip, you would know that the format requires you to enter a normal vector X/Y/Z at each W/L/H point, with optional u,v coordinates, like this:
strip r.g.b [texture] [*gg]
…
W/L/H X/Y/Z