Let's try to draw something by taking into account that there is a third dimension.
Create another project by using TinderBox
and name it
Basic3D. Open the project file (
xcode/Basic3D.xcodeproj on Mac or
vc10\Basic3D.sln on Windows). Open
Basic3DApp.cpp in the editor and navigate to the
draw() method implementation.
Just after the
gl::clear() method add the following line to draw a cube:
gl::drawCube( Vec3f(0,0,0), Vec3f(100,100,100) );
The first parameter defines the position of the center of the cube, the second defines its size. Note that we use the
Vec3f() variables to define position and size within three (x, y and z) dimensions.
Compile and run the project. This will draw a solid cube at the top-left corner of the screen. We are ...