Chapter 5: Shapes, Properties, and Binding

This chapter gets into the nitty-gritty of how you create things in Inventor. It describes the basics of how you create shapes, and describes how to apply properties to those shapes.

Up to Summary of The Inventor Mentor
Back to Chapter 4 - Cameras and Lights
On to Chapter 6 - Text


Shapes

All shapes are subclasses of the SoShape class. There are two major categories of shapes: simple and complex. Simple shapes include cubes, cones, spheres, and cylinders; complex shapes allow you to describe more complex surfaces in a variety of ways -- face sets, line sets, triangle strips, point sets, quad meshes, and NURBS.

Face Sets allow you to define a solid shape in terms of the polygons that make up its faces. You create an array of coordinates containing all of the vertices of all of the faces, in order. Note that this may involve duplication of vertices.

An Indexed Face Set is like a Face Set, except that the vertices are indexed. This allows you to refer to vertices in any order, and reuse them, thus often saving some space.

A Triangle Strip Set allows you to create a surface out of a collection of triangles. It works much like a Face Set, but is somewhat faster to render. (However, it may be more inconvenient for some shapes.)

A Quad Mesh is similar to a Triangle Strip Set, but uses an array of quadrilaterals to define the shape instead of triangles.

NURBS are described in Chapter 8.

Properties

There are a number of different kinds of properties that you can apply, each with a different node class. Whereas shape nodes tell the rendering engine to draw the shape in question, property nodes affect the state of the rendering, changing the way that subsequent shapes will be drawn. Thus, a property must always come before the shapes it is to affect. The following kinds of properties are available: An SoMaterial node affects subsequent objects in the scene. It allows you to specify each object's: An SoDrawStyle lets you define whether shapes should be drawn as filled-in regions (the default), as outlines, as arrays of points, or left invisible. If you choose points, you can specify the size of those points; if lines, you can specify the width and pattern of the lines.

An SoLightModel node allows you to specify whether to use Phong lighting (that is, use the light sources in the scene), or to just display each object in its base color. Phong lighting is the default, and usually looks much more natural.

An SoEnvironment allows you to specify the atmosphere of the scene. Specifically, you can describe:

An SoShapeHints node allows you to specify several characteristics of the subsequent shapes, which can speed up rendering of the scene. These hints include: An SoComplexity node allows you to specify how much you want the renderer to subdivide subsequent objects into polygons. If you specify less subdivision, rendering in generally faster. You can tell it: An SoUnits node allows you to specify the units of measurement for all subsequent shapes in the graph. Almost everything you are likely to want is available, from kilometers down to angstroms, including normal English units (eg, feet, miles), and one or two esoteric ones (eg, nautical miles). Meters are the default unit.

Bindings

A single Material is often insufficient for an object, particularly a complex object. Various parts or faces of the object may call for different colors or reflectivity. Thus, an SoMaterial node can actually hold an unlimited number of materials -- each field in the node can have multiple values. The way that these values are applied to objects is determined by an SoMaterialBinding node. You can specify a number of different ways to bind a list of materials onto an object: If you use indexing, the object in question should use a materialIndex field to specify which materials are bound to which parts of the shape. If you bind materials to vertices, it interpolates between those vertices. Several color plates are provided to illustrate the way Inventor handles materials, lights, and bindings.

Normals

Normals can be specified explicitly, or generated automatically. You can specify them explicitly in much the same way that materials are specified and bound to objects. Most complex objects can compute their normals automatically, but this process is quite compute-intensive, and can slow things down.

Transformations

Transformations are similar to properties in that they affect the state of the rendering engine. However, they are cumulative: a transformation adds to previous transformations, unlike properties, which replace previous properties in the state. You can specify all of the usual sorts of transformations in an SoTransform node. Specifically, you can describe: There are also separate node classes for rotation, translation, and scaling, which are convenient if you are performing only one transformation.


Author/Summarizer:
Mark Waks


Up to Summary of The Inventor Mentor
Back to Chapter 4 - Cameras and Lights
On to Chapter 6 - Text