Game Development Reference
In-Depth Information
Chapter
16
Advanced Topics and Tips
3D graphic programming is sometimes difficult to do. Scene Kit allows you to easily create
an immersive world for your imagination to explore. So far, you have used Scene Kit and
3D graphics in a basic way because this is a beginner-level topic. As you explore deeper in-
to the Scene Kit world, you might want to learn more, so this chapter covers some ad-
vanced topics for you to get started in the right direction. You will also gain some tips on
Xcode that I hope help you in your programming experience.
Normal Mapping
Normal mapping is basically using the bumps and dents of an image to create lighting ef-
fects. These mappings are usually grayscale images that use the varying shades of gray to
show depth and height; these vectors have points that are perpendicular to the surface. By
using a normal map, you can provide a greater amount of detail to your objects.
Vectors and Various Math Operations
Graphics programming relies heavily on vectors to represent almost all objects in some
shape or form. This includes but is not limited to object positions, normals, colors, and
even data structures.
Throughout this topic you have used vectors and some of the operations for them. One im-
portant concept to remember is that a vector can represent different items based on context.
You create a vector by using one of two functions or using the respective initializer.
Throughout this game you used both and saw that both ways work. Swift best practices
would be to use the initializer over the make functions, listed here:
func SCNVector3( x:Float, y:Float, z:Float) -> SCNVector3
func SCNVector3Make( x:Float, y:Float, z:Float) -> SCNVector3
Search WWH ::




Custom Search