SilverScreen Solid Modeler

CopyAndInvert method

CopyAndInvert method

Previous topic Next topic  

CopyAndInvert method

Previous topic Next topic JavaScript is required for the print function  

SilverSharpAPI

 

MATRIX CopyAndInvert();

 

 

 

 

 




Synopsis

using SilverSharp;

 

The CopyAndInvert method makes a copy of the SilverSharp.MATRIX object, inverts it, and returns the copy.

 

 

Parameters

none

 

 

Return Value

CopyAndInvert returns a new SilverSharp.MATRIX object if successful, or null if the original matrix has no inversion.

 

 

Remarks

The returned object may be modified without affecting the original.

 

 

See Also

MATRIX, tm_copy, tm_inverse

 

 

Example

The following code shows how to make an inverse copy of a matrix. The MATRIX mx2 will contain the inverse transformation matrix of mx1 when finished.

 

C# Code

 

 using SilverSharp;

 

 . . .

 

 MATRIX mx1 = new MATRIX();

 

 mx1.Scale(0.5, 0.5, 1.0);

 

 MATRIX mx2 = mx1.CopyAndInvert();

 

 

The following code is equivalent:

 

C# Code

 

 using SilverSharp;

 

 . . .

 

 MATRIX mx1 = new MATRIX();

 

 mx1.Scale(0.5, 0.5, 1.0);

 

 MATRIX mx2 = new MATRIX(mx1);  // Use a copy constructor

 

 mx2.Invert();  // Invert the copy