Pro Java 9 Games Development Leveraging the JavaFX APIs

(Michael S) #1
Chapter 3 ■ advanCed 3d Content rendering: 3d asset ConCepts and prinCiples

Specify the Direction the Surface Is Facing: The Concept of Surface Normals


If you know how to turn the “show normals” feature on in your 3D software, you can see the face surface
normals, which will be displayed as a line coming out of the exact center of the face, as you can see in light
blue in Figure 3-2.
There are also toggles (buttons) in Blender 2.8 for showing vertex normals, which point outward from
the vertex, so for this model the vertex normals point out diagonally from the corners of the cube
(45 degrees), the exact opposite result from the face normals, which point straight up (90 degrees, straight
up, like a skyscraper) coming out of the center of the face (surface, quad). As you can see in Figure 3-2, two of
the normals shown are actually aligned with the x-axis (red) and y-axis (green), which intersect the cube at
90 degrees.
The axis guide is in the lower-left corner of the 3D Edit Mode view, which is also indicated under the
XYZ axis guide at the bottom left of the Blender UI. The function of this surface normal is fairly simple; it tells
the rendering engine which direction the surface is facing. In this case, this cube would render as a cube,
with whatever texture (skin) you give it to color it. The same logic would apply to a vertex normal; it would
show the rendering engine which side of your 3D geometry to process for surface rendering.
If the normals in this cube geometry had been pointing inward instead of outward, the cube would not
be visible at all when rendered. There’s a flip normals operation (algorithm) in 3D software that is used to
reverse your normal directions for a model universally (all normals are flipped 180 degrees). This will be
utilized when you render a scene, and your imported object is not visible when you render the scene.
Flipped normals can appear when the 3D import utility points (flips) the normals for imported 3D
geometry in the wrong direction or when the exporter from the other 3D tool exported them in the wrong
direction, relative to the software you are importing them into. This will be a fairly common occurrence in
your 3D workflow, so expect to use this flip normals function at least a few times if you are going to work in
3D, or in i3D, frequently.


Figure 3-2. Use the “Display face normals as lines” button to show direction normals for each quad face as
light blue lines

Free download pdf