]> git.pond.sub.org Git - eow/blob - static/dojo-release-1.1.1/dojox/gfx3d/tests/test_orbit.html
add Dojo 1.1.1
[eow] / static / dojo-release-1.1.1 / dojox / gfx3d / tests / test_orbit.html
1 <html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" >
2 <head>
3 <title>Orbit 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";
8 </style>
9 <script type="text/javascript" src="../../../dojo/dojo.js" djConfig="isDebug: true"></script>
10 <script type="text/javascript">
11
12 dojo.require("dojox.gfx3d");
13
14 makeObjects = function(){
15         var surface = dojox.gfx.createSurface("test", 500, 500);
16         var view = surface.createViewport();
17         var m = dojox.gfx3d.matrix;
18
19         view.createOrbit({center: {x: 0, y: 0, z: 0}, radius: 80})
20                 .setStroke({color: "blue", width: 1});
21
22         var camera = dojox.gfx3d.matrix.normalize([
23                 m.cameraRotateXg(60), 
24                 m.cameraRotateYg(30),
25                 m.cameraRotateZg(0),
26                 m.cameraTranslate(-300, -100, 0)
27         ]);
28
29         view.applyCameraTransform(camera);
30         view.render();
31 };
32
33 mdebug = function(matrix){
34         var m = dojox.gfx3d.matrix.normalize(matrix);
35         console.debug("xx: " + m.xx + ", xy: " + m.xy + " | xz:" + m.xz + " | dx:" + m.dx);
36         console.debug("yx: " + m.yx + ", yy: " + m.yy + " | yz:" + m.yz + " | dy:" + m.dy);
37         console.debug("zx: " + m.zx + ", zy: " + m.zy + " | zz:" + m.zz + " | dz:" + m.dz);
38 };
39
40 dojo.addOnLoad(makeObjects);
41
42 </script>
43 </head>
44 <body>
45         <h1>Orbit Test</h1>
46         <p>Test how orbit looks like in 3D</p>
47 <div id="test" style="width: 500px; height: 500px;"></div>
48 <p>That's all Folks!</p>
49 </body>
50 </html>