examples/3d/ofNodeExample/README.md
This tutorial shows how to use the ofNode to build a hierarchy of objects, it was originally developed in a workshop held by Arturo Castro at Lacuna Lab.
Most 3D classes in OF inherit from ofNode. ofNode is simply a class that defines a point in a 3D space and allows it to:
We will define an ofNode directly in this example and use its powerful methods to move around the truck. The children will move along with it.
In this example we want to create a truck with a body, 2 headlamps, 4 wheels and an OF logo in the truck bed. We want to move the lights, wheels and OF logo together with the truck, without re-calculating the position child objects.
We define only how the truck should move into the space, the lights just need to stay on the front of the truck, and their movement is just a consequence of the movement of the truck.
Have a look at the Truck.cpp file to see how we attach the lights on the front of the truck and how to move the object using the handy rotate, move and tilt methods - without needing to use ofPushMatrix and ofPopMatrix. The wheels rotate and the truck body responds to the steering and forward/backwards movement.
Also take note of the sounds and when they are triggered in the Truck.cpp update function.
In the example, pay attention to:
roadMaterialWhen launching this app, you should see a screen with:
Instructions for using the app:
r key to reset the location of the truck.