Reader small image

You're reading from  Mathematics for Game Programming and Computer Graphics

Product typeBook
Published inNov 2022
PublisherPackt
ISBN-139781801077330
Edition1st Edition
Tools
Right arrow
Author (1)
Penny de Byl
Penny de Byl
author image
Penny de Byl

Penny de Byl is a full stack developer with an honors in graphics and Ph.D. in artificial intelligence for games. She has a passion for teaching, teaching games development and computer graphics for over 25 years in universities in Australia and Europe. Her best-selling textbooks, including Holistic Game Development with Unity, are used in over 100 institutions. She has won numerous awards for teaching, including an Australian Government Excellence in Teaching Award and the Unity Mobile Game Curriculum Competition. Her approach to teaching computer science and related fields is project-based giving you hands-on workshops you can immediately get your teeth into. The full range of her teaching interests can be found at H3D Learn.
Read more about Penny de Byl

Right arrow

Defining polygon sides with normals

So far in this book, we’ve calculated normals but not explored their many uses. One of these uses is to dictate which side of a polygon is visible. The same plane that you have been using up to this point has had the normals reversed in Autodesk Maya, a 3D modeling program, for the center polygons, as shown in Figure 11.4:

Figure 11.4: A plane with some normals reversed

The black section in the middle of the plane in Figure 11.4 when rendered would in fact appear as a hole when viewed from one direction and solid from the other. Even though it might look like a hole, that doesn’t mean there aren’t any polygons covering this area. When this plane is drawn with a cube behind it in Python and OpenGL, the hole is evident, as shown in Figure 11.5 (a):

Figure 11.5: A plane with normals reversed viewed from both sides

As can be seen in Figure 11.5, whichever polygons have normals on...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Mathematics for Game Programming and Computer Graphics
Published in: Nov 2022Publisher: PacktISBN-13: 9781801077330

Author (1)

author image
Penny de Byl

Penny de Byl is a full stack developer with an honors in graphics and Ph.D. in artificial intelligence for games. She has a passion for teaching, teaching games development and computer graphics for over 25 years in universities in Australia and Europe. Her best-selling textbooks, including Holistic Game Development with Unity, are used in over 100 institutions. She has won numerous awards for teaching, including an Australian Government Excellence in Teaching Award and the Unity Mobile Game Curriculum Competition. Her approach to teaching computer science and related fields is project-based giving you hands-on workshops you can immediately get your teeth into. The full range of her teaching interests can be found at H3D Learn.
Read more about Penny de Byl