CREATING A 3D MAZE MODEL
I will be demonstrating 2 methods of creating a maze model. The first uses Cinema 4D, the second Maya.
If you are an educator or student, you can get an educational license for Maya for free. Cinema 4D is not free for schools, but students at schools with site licenses can get a 3 yr educational license.
After teaching 3D graphics for 14 years, I'm a big fan of Cinema 4D. I find that students catch on to the interface, and processes faster than with Maya or Blender. I don't use Blender, but there are similar process in that program.
Cinema 4D Method
The first step is to find a black and white maze layout. Right Click here to download the graphic I trace from.
- Open Cinema 4D and select vectorizer from the Splines menu.
- Keep the Vectorizer object selected. In the attributes window, on the Object tab, there is an option for Texture; click on the button with 3 dots to select the maze graphic you downloaded.
- Change the Tolerance setting to 1 cm and the Plane setting to XZ, Intermediate points to None.
- Make sure you have the Vectorizer object selected as an Object or Model, then press the c key. This will change the Vectorizer object into an editable spline.
- From the NURBS menu select an Extrude object. In the Object tab, change the Movement settings from x=0 y=0 z=20, to x=0 y=80 z=0.
- Click on the Vectorizer spline object in the Objects window and drag it towards the Extrude Object until you see an arrow pointing down. This makes the spline a child of the extrude and the shape of the spline is extruded into 3D space.
- In order to prepare the Maze model to accept materials properly in Unity, it must be converted into an editable object, a polygon model with a UV map. UV's are the 2D equivalent of 3D points, edges and polygons. It's the same idea as translating the map on a globe, to a map in an atlas. If we skip this step, the textures on some parts of the maze may be distorted.
- Select the Extrude Object and press the c key. This will convert the extrude into a main object, which is the walls of the maze, and two child objects, which are the bottom and top of the walls. These objects will be hidden, but clicking on the plus sign beside the Extrude object will reveal them. Select all three objects by holding the shift key down and clicking on them, or Select the Extrude object and from the Objects Menu select Edit>Select Children.
- With all the objects selected, from the top menu select Mesh>Conversion>Connect Objects and Delete. This will combine the three objects into one.
- To set up a UV map in Cinema 4D change the Layout to UV edit. Click on the right hand window, and select UV Mesh>Show UV Mesh. At this point the mesh will just show as a bunch of vertical lines. On the UV Mapping tab, select Optimal Mapping>Optimal(Cubic). This will sort the UVs into a flat layout.
- Finally, the model can be exported into any Unity project by selecting File>Export>FBX. Select the Assets folder for the correct game project. You might want to create a new folder, and name it models. If the model had animations, we could export them, but we only need to export the model. Keep the normals checked but turn off the other options and click on OK.
- Open the Unity project. The maze model should be available as an Asset. If not, check whether you exported the file inside the Assets folder.
- See the Unity Maze Game project for how to place the maze into the game scene.