1 <html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" >
3 <title>Dojo 3D Matrix</title>
4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5 <style type="text/css">
6 @import "../../../dojo/resources/dojo.css";
7 @import "../../../dijit/tests/css/dijitTests.css";
9 <script type="text/javascript" src="../../../dojo/dojo.js" djConfig="isDebug: true"></script>
10 <script type="text/javascript">
12 dojo.require("dojox.gfx3d");
14 mdebug = function(matrix){
15 var m = dojox.gfx3d.matrix.normalize(matrix);
16 console.debug("xx: " + m.xx + ", xy: " + m.xy + " | xz:" + m.xz + " | dx:" + m.dx);
17 console.debug("yx: " + m.yx + ", yy: " + m.yy + " | yz:" + m.yz + " | dy:" + m.dy);
18 console.debug("zx: " + m.zx + ", zy: " + m.zy + " | zz:" + m.zz + " | dz:" + m.dz);
21 pdebug = function(point){
22 console.debug("x: " + point.x + ", y: " + point.y + ", z: " + point.z);
25 dojo.addOnLoad(function(){
26 var m = dojox.gfx3d.matrix;
27 var a = new m.Matrix3D();
28 console.debug("identity");
31 console.debug("rotateXg(30);");
34 console.debug("rotateYg(45);");
37 console.debug("rotateZg(90);");
39 a = [new m.Matrix3D(), new m.Matrix3D(), new m.Matrix3D()];
40 console.debug("identity");
42 a = [m.rotateXg(30), m.rotateXg(-30)];
43 console.debug("identity");
45 var b = m.multiplyPoint(a, 10, 10, 10);
47 b = m.multiplyPoint(a, 10, 5, 10);
49 b = m.multiplyPoint(a, 10, 15, 5);
52 a = [m.scale(1,1,2), m.rotateXg(45)];
53 console.debug("a = [m.scale(1,1,2), m.rotateXg(45)];");
55 a = [m.rotateXg(45), m.scale(1,1,2)];
56 console.debug("a = [m.rotateXg(45), m.scale(1,1,2)];");
59 a = [m.scale(2,1,2), m.rotateYg(45)];
60 console.debug("a = [m.scale(2,1,2), m.rotateYg(45)];");
62 a = [m.rotateYg(45), m.scale(2,1,2)];
63 console.debug("a = [m.rotateYg(45), m.scale(2,1,2)];");
66 a = [m.scale(1,2,1), m.invert(m.rotateZg(45))];
67 console.debug("[m.scale(1,2,1), m.invert(m.rotateZg(45))];");
69 a = [m.invert(m.rotateZg(45)), m.scale(1,2,1)];
70 console.debug("a = [m.invert(m.rotateZg(45)), m.scale(1,2,1)];");
74 console.debug("identity");
79 a = [2, m.scale(2,1,3)];
86 <h1>dojox.gfx3d.matrix test</h1>
87 <p>Please check the debug console for test results.</p>