meta data for this page
  •  

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
en:design_guide_transform [2020/11/28 02:59]
JSCAD Editor created
en:design_guide_transform [2020/12/08 06:53] (current)
JSCAD Editor
Line 1: Line 1:
 ==== Matrix Transform ==== ==== Matrix Transform ====
  
-The previous transforms are actually simplified versions of matrix mathematics. For example, translate is just applying additition using a matrix.+The previous transforms are actually simplified versions of matrix mathematics. For example, translate is just applying addition using a matrix.
  
 //[[http://www.mathsisfun.com/algebra/matrix-introduction.html|Learn about matrix mathematics at MathIsFun.com]]// //[[http://www.mathsisfun.com/algebra/matrix-introduction.html|Learn about matrix mathematics at MathIsFun.com]]//
  
 <code javascript> <code javascript>
-let new CSG.Matrix4x4() +let matrix mat4.create() 
-m.multiply(CSG.Matrix4x4.rotationX(40)) +matrix mat4.multiply(mat4.rotationX(40)) 
-m.multiply(CSG.Matrix4x4.rotationZ(40)) +matrix mat4.multiply(mat4.rotationZ(40)) 
-m.multiply(CSG.Matrix4x4.translation([-.5, 0, 0])) +matrix mat4.multiply(mat4.translation([-.5, 0, 0])) 
-m.multiply(CSG.Matrix4x4.scaling([1.1, 1.2, 1.3]))+matrix mat4.multiply(mat4.scaling([1.1, 1.2, 1.3]))
  
-// and apply the transform: +// and apply the transform 
-let cube3 = cube().transform(m)+const myshape transform(matrix, cube())
 </code> </code>