Materials Assignment and Texture Coordinates
 
 
 

Materials and NURBS

Each NURBS surface has its own material ID. If you assign a Multi-SubObject material you can apply a different material to each surface in a NURBS object. The method to do this is NURBSSurface::MatID(). In release 3.0 and later each NURBSCurve can have an associated material. This is used by the Lathe and Extrude modifiers for example.

Texture Coordinates and NURBS

Texture coordinates are assigned to each of the four corners of a NURBS surface. On the standard 3ds Max primitives for example most are assigned to use (0,0) to (1,1) across the surface. Some primitive, such as the Prism, don't use (0,0) to (1,1) because of the way they wrap. Developers may of course assign any values using the API. The method to do this is NURBSSurface::SetTextureUVs().

Sample Code

There is a demonstration utility plugin that utilizes the NURBS API. This is available in \MAXSDK\SAMPLES\UTILITIES\NURBS\. This is an excellent place to look for simple, clear sample code.

The standard 3ds Max primitives also use the NURBS API. See this code in the various primitive objects in directory\MAXSDK\SAMPLES\OBJECTS. Additionally, the Lathe and Extrude use the API. Developers can review this code in \MAXSDK\SAMPLES\MODIFIERS\EXTRUDE.CPP andSURFREV.CPP.