Director 3D > Creating Simple 3D |
Creating Simple 3D > > Custom Handlers > Links |
Creating 3D Primitives |
“Primitives” are considered to be the building blocks of 3D environments. They are (apart from ‘particles’) simple shapes that require a small number of parameters. The five “primitive” types are #plane, #sphere, #box, #cylinder and #particle. Although simple, primitives can be used for very powerful results. Broad, sweeping objects that satisfy large goals of an environment, such as the sky or ground are examples of this. Lighting and texture techniques can also be used to simulate complex shapes. Here is an example of the Lingo used to create a primitive shape (in this case, a sphere.
sphereResource = pScene.newModelResource("SphereResource", #sphere, #facing) newModelResource creates a new model resource of a particular “#type” (one of the following primitives #plane, #box, #sphere, #cylinder, #particle). #facing defines if the mesh is generated for front (the outside of the sphere – it would appear invisible from inside) or back only (the inside of the sphere – it would appear invisible from outside), or both. If you have mesh for front and back, you can have separate shaders for each.
Here is an example:
You can download the source file here. A good tutorial on the creation of 3D models, through the control of primitives with Lingo can be found at this location:http://www.fbe.unsw.edu.au/learning/director/3D/3dLingo.htm Another good starting point is “Director’s Third Dimension: Fundamentals of 3D Programming in Director 8.5” by Paul Catanese (Que, 2002) – Chapter 2 is particularly recommended for a good understanding of this subject. |
Creating Simple 3D > > Custom Handlers > Links |
July 2003 |