Kekouan

Best laid plans, undone

2023-06-06

The first thing I wanted to sort out was going to be some way of handling interactions between my "level geometry" and the player. There's a lot of ways to solve that set of problems, but I endeavoured to make SceneKit's problem so I didn't have to deal with it.

A SceneKit scene that has the default jet model, and two simple objects

A SceneKit scene that has the default jet model, and two simple objects

The base object in SceneKit Scene is called a SCNNode

A structural element of a scene graph, representing a position and transform in a 3D coordinate space, to which you can attach geometry, lights, cameras, or other displayable content.

So I've created two new nodes, given them the geometry of a pyramid and a sphere. They also have a physics system which means that when the jet model collides with the pyramid, it causes the wing to lift up. Or when the jet model collides with the sphere, it rotates.

Great. Excellent.

Levels, Mapping

One problem though, is that a game world populated entirely with spheres and pyramids is only so compelling. I need to be able to create arbitrary structures or layouts.

A screenshot of a Blender window, showing a two cubes joined by a corridor

The last time I spent any time with a 3D Modelling application was quite some time ago, and I preferred Modo. However in the intervening span of time, Blender has become the de-facto modelling application for people who do not have some reason to use things like Maya or the other high quality and very expensive applications.

It works though, surprisingly.

A SceneKit scene that has the default jet model, and two simple objects, and the model from Blender

The jet model dutifully bounces off the walls. I now have a way of creating things in Blender and making use of them in my project.