1 <html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" >
3 <title>Edges test of dojox.gfx3d.</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 makeObjects = function(){
15 var surface = dojox.gfx.createSurface("test", 500, 500);
16 var view = surface.createViewport();
18 {x: 100, y: 10, z: 5},
19 {x: 80, y: 80, z: 55},
20 {x: 120, y: 80, z: 75},
21 {x: 250, y: 92, z: 15},
22 {x: 200, y: 25, z: 5},
23 {x: 156, y: 40, z: 45}
26 var m = dojox.gfx3d.matrix;
27 var loop = view.createEdges(lines, "loop")
28 .setStroke({color: "blue", width: 1})
29 .applyTransform(dojox.gfx3d.matrix.translate({x: 0, y: 0, z: 0}));
31 var strip = view.createEdges(lines, "strip")
32 .setStroke({color: "red", width: 1})
33 .applyTransform(dojox.gfx3d.matrix.translate({x: 0, y: 100, z: 0}));
35 var normal = view.createEdges(lines)
36 .setStroke({color: "lime", width: 1})
37 .applyTransform(dojox.gfx3d.matrix.translate({x: 0, y: 200, z: 0}));
39 var camera = dojox.gfx3d.matrix.normalize([
41 //m.cameraRotateYg(30),
42 //m.cameraRotateXg(50),
43 m.cameraTranslate(0, 0, 0)
46 view.applyCameraTransform(camera);
50 mdebug = function(matrix){
51 var m = dojox.gfx3d.matrix.normalize(matrix);
52 console.debug("xx: " + m.xx + ", xy: " + m.xy + " | xz:" + m.xz + " | dx:" + m.dx);
53 console.debug("yx: " + m.yx + ", yy: " + m.yy + " | yz:" + m.yz + " | dy:" + m.dy);
54 console.debug("zx: " + m.zx + ", zy: " + m.zy + " | zz:" + m.zz + " | dz:" + m.dz);
58 dojo.addOnLoad(makeObjects);
64 <p> Test of the Edges, there are three modes</p>
66 <li>none, any two vertice pair form one edge, lime</li>
67 <li>strip, vertices are connected by edges. red</li>
68 <li>loop, the same as strip, close the path, blue</li>
70 <div id="test" style="width: 500px; height: 500px;"></div>
71 <p>That's all Folks!</p>