EvaluatePosition2 (NurbsSurface) *

Introduced

4.0

Description

Returns the Position, U tangent, V Tangent and Normal at a given UV value in the same order as NurbsSurface.EvaluatePosition.

Note: This method must be used with scripting languages that don't support arguments passed by reference such as JScript and PerlScript. For more information on getting output arguments, see About Output Argument Arrays.

Scripting Syntax

NurbsSurface.EvaluatePosition2( UValue, VValue )

C# Syntax

Object NurbsSurface.EvaluatePosition2( Double in_dUValue, Double in_dVValue );

Parameters

Parameter

Type

Description

UValue

Double

The UValue at which we want to evaluate the surface.

VValue

Double

The VValue at which we want to evaluate the surface.

Return Value

Array that contains SIVector3 objects representing the position, u tangent, v tangent and normal at the given UV.

Examples

JScript Example

/*
   This example illustrates how to retreive the spatial position of a knot.
*/

var oSphere = ActiveSceneRoot.AddGeometry( "Sphere", "NurbsSurface" );
var oSurfaces = oSphere.ActivePrimitive.Geometry.Surfaces;
var oSurface  = oSurfaces(0);

var aUKnotValues = new VBArray(oSurface.UKnots.Array);
var aVKnotValues = new VBArray(oSurface.VKnots.Array);

var aValues = new VBArray(oSurface.EvaluatePosition2( aUKnotValues.getItem(3), aVKnotValues.getItem(4)));

var oPosition = aValues.getItem(0);
var oUTangent = aValues.getItem(1);
var oVTangent = aValues.getItem(2);
var oNormal = aValues.getItem(3);

LogMessage( "Position: " + oPosition.x + ", " + oPosition.y + ", " + oPosition.z );
LogMessage( "Tan U: " + oUTangent.x + ", " + oUTangent.y + ", " + oUTangent.z );
LogMessage( "Tan V: " + oVTangent .x + ", " + oVTangent .y + ", " + oVTangent .z );
LogMessage( "Normal: " + oNormal.x + ", " + oNormal.y + ", " + oNormal.z );

//--------------------------------------------------
// Output of above script:
//INFO : "Position: -4.718447854656915e-16, -2.828427124746189, 2.8284271247461916"
//INFO : "Tan U: 1, 0, 1.8784326741201244e-16"
//INFO : "Tan V: -5.3007381947367376e-17, 0.706986783671791, 0.7072267583409271"
//INFO : "Normal: -1.3280270746201882e-16, -0.7072267583409272, 0.7069867836717909"


Autodesk Softimage v7.5