From the course: Building a 3D Game in SceneKit

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Geometry objects

Geometry objects

From the course: Building a 3D Game in SceneKit

Start my 1-month free trial

Geometry objects

- [Narrator] If we want to have any content that is visible to the camera we created, we need to add an object to the node. In this project, we're going to take advantage of several geometric objects that are available to us in SceneKit, as seen here, including the pyramid, cone, the cylinder, the sphere, and torus. So, in order to create these shapes, we're going to create a new Swift file in our project and define the different shapes using a shape type enum. So, index code, I'm going to go the SceneKit intro group, and I'm going to press command N to create a new file. With iOS selected here, at the top, I'm going to make sure I select Swift File and then click Next. And I'm going to call it Shapes.swift. And then click Create. Within the Shapes.swift file, we're going to create those shapes using the shape type enum. So, just under import Foundation, we're going to press return, type enum ShapeType:Int, and add that open curly brace, press Return, and again, Xcode creates the…

Contents