All of the sample code for this book is available on GitHub. There is a sample project for most chapters in the book, and some chapters have more than one sample project.
The repository contains the finished projects for you to download and experiment with. This is the same code that you will find at the end of each chapter (in the book itself). Some chapters require assets (3D models and/or textures) to follow along in your own project with what is being explained in the book. In those cases the folder also contains an Assets folder for you to download.
These projects are documented to the extent of explaining what is happening in the code, but not necessary enough to explain underlying concepts. That is what the book is for. The sample projects are made to make sense if you’ve followed along with the chapter in the book.
Get something to show up on the screen as quickly as possible. Introduces concepts such as lights, cameras, nodes, geometry and materials.
Chapter 2 - Lights & Materials
Get more familiar with lights and materials and how their configurations work together to create different visual effects.
Leverage the node hierarchy to create a scene with more things in it. Introduces shadows, reflection, and animation using Core Animation.
Create extruded 3D objects from Bézier paths and use them to build a pie chart.
Chapter 4 - Adding Detail with Images
Render a COLLADA (.dae) file. Use images and Core Animation layers as textures to add more detail to a 3D object. Learn to export a scene and its textures.
Import geometry objects from a COLLADA (.dae) file. Copy and modify the imported objects to put different chess pieces on a board. Hit-test the scene to determine which chess piece was clicked.
Perform advanced hit-testing on a 3D object representing the earth to position a pin on the clicked location, make the pin perpendicular to the surface of the earth, and approximate the geographical location of the clicked point.
Create a custom geometry object (a cube) made out of triangles. Introduces geometry sources and geometry elements, and shows what it means to create a geometry element with multiple elements.
Chapter 7 - Custom Mesh Geometry
Use a triangle strip to create a more advanced geometry object out of dynamic data.
Recreate the default Scene Kit shading with custom shaders in GLSL (the OpenGL Shading Language) and create more custom rendering effects that wouldn’t be possible by just configuring lights and materials.