Class NURBSProceeduralSurface

3DS Max Plug-In SDK

Class NURBSProceeduralSurface

See Also: Class NURBSCVSurface, Class NURBSSurface.

class NURBSProceeduralSurface

Description:

This class is available in release 3.0 and later only.

This is the base class for a proceedurally defined surface. Note: This class is not subclassed from NURBSObject. You must use the GenNURBSCVSurfaceProcedurally() function.

The following typedef-ed functions are used by the GenNURBSCVSurfaceProcedurally() function.

Prototype:

typedef NURBSResult (*SurfParamRangeProc)(double& uMin, double& uMax, double& vMin, double& vMax);

Remarks:

The surface parameter range procedure. This retrieves the minimum and maximum valid values for u and v as passed to the SurfEvalProc().

Parameters:

double& uMin

The min U value.

double& uMax

The max U value.

double& vMin

The min V value.

double& vMax

The max V value.

Return Value:

See List of NURBS Results .

Prototype:

typedef NURBSResult (*SurfEvalProc)(double u, double v, Point3& pt);

Remarks:

This evaluates the surface for the point or position at a given U and V parameter.

Parameters:

double u

Specifies the U point along the surface to evaluate. This value must be between the uMin and uMax as returned from SurfParamRangeProc().

double v

Specifies the V point along the surface to evaluate. This value must be between the vMin and vMax as returned from SurfParamRangeProc().

Point3& pt

The output point on the surface at (u,v).

Return Value:

See List of NURBS Results .

Prototype:

typedef NURBSResult (*SurfEvalTan)(double u, double v, Point3& uTan, Point3& vTan);

Remarks:

This evaluates the surface for the partial derivative with respect to U and the partial derivative with respect to V at a given U and V parameter. That partial derivative with respect to U is a tangent vector in the U direction and the partial derivative with respect to V is a tangent vector in the V direction.

Parameters:

double u

Specifies the U point along the curve to evaluate. This value must be between the uMin and uMax as returned from SurfParamRangeProc().

double v

Specifies the V point along the surface to evaluate. This value must be between the vMin and vMax as returned from SurfParamRangeProc().

Point3& uTan

The tangent along u.

Point3& vTan

The tangent along v.

Return Value:

See List of NURBS Results .

Prototype:

typedef NURBSResult (*SurfEvalMixedProc)(double u, double v, Point3& mixed);

Remarks:

This evaluates the surface for the mixed partial derivative with respect to U and V at a given U and V parameter.

Parameters:

double u

Specifies the U point along the curve to evaluate. This value must be between the uMin and uMax as returned from SurfParamRangeProc().

double v

Specifies the V point along the surface to evaluate. This value must be between the vMin and vMax as returned from SurfParamRangeProc().

Point3& mixed

This is the resulting mixed partial derivative vector that has been evaluated.

Return Value:

See List of NURBS Results .

Data Members:

public:

SurfParamRangeProc mParamProc;

The surface parameter range procedure. Note: This procedure must be implemented.

SurfEvalProc mEvalProc;

The surface evaluation procedure. Note: This procedure must be implemented.

SurfEvalTan mEvalTanProc;

The surface tangent evaluation procedure. Note: This procedure is optional.

SurfEvalMixedProc mEvalMixedProc;

The mixed partial derivative procedure. Note: This procedure is optional.

Methods:

public:

Prototype:

NURBSProceeduralSurface(SurfParamRangeProc param, SurfEvalProc eval, SurfEvalTan tan, SurfEvalMixedProc mixed);

Remarks:

Constructor. The data members are initialized to the values passed.

Both (*SurfEvalTan) and (*SurfEvalMixedProc) are optional. If NULLs are provided for either of these functions then 3ds max will resort to a finite differences based solution.

Parameters:

The following global function is not part of this class but is available for use:

Function:

NURBSResult GenNURBSCVSurfaceProceedurally(NURBSProceeduralSurface *pSurf, double tolerence, NURBSCVSurface& surf);

Remarks:

This global function is available in release 3.0 and later only.

To use this function you need to create an instance of NURBSProceeduralSurface setting at least the ParameterRange and Eval procedures. The others can be NULL unless you have fast versions of them. This call then fills in a NURBSCVSurface with the surface that is defined by the procedures and the tolerence.

Parameters:

NURBSProceeduralSurface *pSurf

Points to the NURBSProceeduralSurface to generate CV surfaces from.

double tolerence

The tolerance is the allowable deviation of the approximating NURBS surface to the surface defined by the procs.

NURBSCVSurface& surf

The generated NURBSCVSurface is returned here.

Return Value:

See List of NURBS Results .