SilverScreen Solid Modeler

CopyAndTransform method

CopyAndTransform method

Previous topic Next topic  

CopyAndTransform method

Previous topic Next topic JavaScript is required for the print function  

SilverSharpAPI

 

SS_XYZ[] CopyAndTransform( SS_XYZ[] pts )

 

SS_XYZ[] pts;   // An array of 3D points

 

 

 




Synopsis

using SilverSharp;

 

The CopyAndTransform method makes a copy of an array of 3D points, transforms them through the SilverSharp.MATRIX object, then returns the array of transformed points.

 

 

Parameters

pts is an array of 3D points to be transformed

 

 

Return Value

CopyAndTransform returns an array of transformed 3D points

 

 

Remarks

The points in the original array are unaffected

 

 

See Also

MATRIX, tm_transform

 

 

Example

The following code creates an array of 3D points representing a unit square, builds a matrix to scale x  by 5 and y by 2, transforms the array into another, and draws a polygon with the new point array:

 

C# Code

 

 using SilverSharp;

 

 . . .

 

 SS_XYZ[] unit_square =

    {

    new SS_XYZ(0.0, 0.0, 0.0),

    new SS_XYZ(1.0, 0.0, 0.0),

    new SS_XYZ(1.0, 1.0, 0.0),

    new SS_XYZ(0.0, 1.0, 0.0),

    };

 

 MATRIX mx = new MATRIX();

 

 mx.Scale(5.0, 2.0, 1.0);

 

 SS_XYZ[] scaled_square = mx.CopyAndTransform(unit_square);

 

 SC.draw_polygon(scaled_square);