All the 2D graphical shapes can work in the 3D environment. In addition, GEM provides a number of 3D primitives, such as cone
, cube
, cuboid
, curve3d
, cylinder
, disk
, sphere
, teapot
, torus
, and tube
. Let us learn it step-by-step by following a similar procedure.
Create an empty patch and save it with name gem003.pd
in your folder. Put the gemwin
object, create
and destroy
messages, and the toggle box for rendering.
We start from the simplest 3D object, cube
. Put the gemhead
and cube
objects and connect them together. Similar to 2D shapes, we can also have the draw fill
and draw line
messages. Here is the patch and the resulting window. By using the draw line
message, the 3D perspective projection of the cube is more obvious:
Here is the wire-frame rendering of the cube in the three-dimensional space:
Control for the cube
object is simple. It has only one number inlet for its size. The next object is sphere
. It has two parameters. One for the size and another...