SilverScreen Solid Modeler

Scale methods

Scale methods

Previous topic Next topic  

Scale methods

Previous topic Next topic JavaScript is required for the print function  



void Scale(double xScale, double yScale, double zScale);

void ScaleX(double xScale);

void ScaleY(double yScale);

void ScaleZ(double zScale);


double xScale;  // A double-precision floating-point x-axis scale value

double yScale;  // A double-precision floating-point y-axis scale value

double zScale;  // A double-precision floating-point z-axis scale value



using SilverSharp;


The Scale methods post-multiply a matrix that scales along coordinate axes. The first form scales all 3 axes, while the others are single-axis scalings.




xScale is a scaling factor for the x-axis

yScale is a scaling factor for the y-axis

zScale is a scaling factor for the z-axis



Return Value





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



See Also

MATRIX, tm_scale_x, tm_scale_y, tm_scale_z




The following code builds a matrix to scale along the x-axis by 0.5 and the y-axis by 2.0 about a basepoint:


C# Code


 using SilverSharp;


 . . .


 MATRIX mx = new MATRIX();

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


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

 mx.Scale( 0.5, 2.0, 1.0 );   // Perform scaling

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