SilverScreen Solid Modeler

Translate method

Translate method

Previous topic Next topic  

Translate method

Previous topic Next topic JavaScript is required for the print function  

SilverSharpAPI

 

void Translate(double dx, double dy, double dz);

void Translate(SS_XYZ pt);

 

double dx;  // A double-precision floating-point x-coordinate

double dy;  // A double-precision floating-point y-coordinate

double dz;  // A double-precision floating-point z-coordinate

SS_XYZ pt;  // An SS_XYZ object representing a 3D point

 

 




Synopsis

using SilverSharp;

 

The Translate method post-multiplies a matrix that translates a 3D point to the origin

 

 

Parameters

dx is a value for the x-coordinate of the point to translate

dy is a value for the y-coordinate of the point to translate

dz is a value for the z-coordinate of the point to translate

pt is a 3D point to translate to the origin

 

 

Return Value

none

 

 

Remarks

This method post-multiplies a translation matrix into the SilverSharp.MATRIX object. This means it adds the work of a translation to the transformation.

 

 

See Also

MATRIX, tm_translate

 

 

Example

The following code builds a matrix to rotate 45 degrees about a 3D point.

 

C# Code

 

 using SilverSharp;

 

 . . .

 

 MATRIX mx = new MATRIX();

 SS_XYZ pt = new SS_XYZ(15.0, 15.0, -10.0);

 

 mx.Translate( - pt ); // Translate pt to the origin

 mx.RotateZ( 45.0 );   // Rotate about the origin

 mx.Translate( pt );   // Translate the origin to pt