Bcc.GetRotationMatrixXYZ(xAngleDegree, yAngleDegree, zAngleDegree)

Description

Provides the 4x4 rotation matrix when rotating around X, Y, Z axes with degree values.

Parameters


  • xAngleDegree - double value representing the degrees to rotate around the X axis
  • yAngleDegree - double value representing the degrees to rotate around the Y axis
  • zAngleDegree - double value representing the degrees to rotate around the Z axis


Return

Returns a 4x4 matrix containing the rotations specified in degrees.


The format of the return is the following assuming you have returned to a variable named matrix:


matrix[1] = {1,0,0,0}

matrix[2] = {0,1,0,0}

matrix[3] = {0,0,1,0}

matrix[4] = {0,0,0,1}

Examples


The following example shows the result of calculating a rotation which is 45 degrees around X


-- Get the matrix for rotating 45 degrees around X

matrix = Bcc.GetRotationMatrixXYZ(45,0,0)

               

-- Value to build the string for display

temp = ""

-- Iterate through the table and sub tables to display the values

for k,v in ipairs(matrix) do

       if type(v) == "table" then

               for kk, vv in ipairs(v) do

                       temp = temp..vv..", "

               end

       else

       temp = temp..v..", "

       end

       temp = temp.."\n"

end


-- Display a message box of the resulting matrix                 

Bcc.ShowMessageBox(temp)