Geometric Primitives Supported by the Graphics Window
 
 
 

The geometric primitives supported by the GraphicsWindow class were designed to provide optimal support for rendering triangular meshes. As noted earlier, the preferred way to render such meshes is through the Mesh::Render() method.

If you need to use the geometric primitives in the GraphicsWindow class directly, you should be aware that there is no direct support for illuminated primitives, so rendering illuminated surfaces is a two-step process.

There are two levels of primitive support within the GraphicsWindow class: one set uses device-independent 3D eye coordinates and the other uses device-dependent window coordinates. At each level there are routines for polylines, polygons (triangles), markers, and annotation text.

The device-dependent routines do not provide any support for clipping or range testing. For speed, these routines assume that all coordinate values passed in are valid. If invalid values are present, the results are unpredictable, but a program crash or corruption of the 3ds Max system is almost guaranteed.

The higher-level routines transform their coordinate lists through the current affine and camera transformations, clipping when necessary, and then call the corresponding low-level routines.

These routines are designed to optimize the rendering of meshes composed of vertex and connectivity lists. This process works as follows:

Note that this approach only transforms and clip-checks most vertices once. Only in the rare case that a primitive is clipped do the associated vertices have to be transformed again. Since most vertices in a mesh are shared, this provides an efficient means to rasterize the entire mesh.