meta data for this page
Differences
This shows you the differences between two versions of the page.
| 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 | + | The previous transforms are actually simplified versions of matrix mathematics. For example, translate is just applying |
| // | // | ||
| <code javascript> | <code javascript> | ||
| - | let m = new CSG.Matrix4x4() | + | let matrix |
| - | m = m.multiply(CSG.Matrix4x4.rotationX(40)) | + | matrix |
| - | m = m.multiply(CSG.Matrix4x4.rotationZ(40)) | + | matrix |
| - | m = m.multiply(CSG.Matrix4x4.translation([-.5, | + | matrix |
| - | m = m.multiply(CSG.Matrix4x4.scaling([1.1, | + | matrix |
| - | // and apply the transform: | + | // and apply the transform |
| - | let cube3 = cube().transform(m) | + | const myshape |
| </ | </ | ||