summaryrefslogtreecommitdiffstatshomepage
path: root/includes/js/dojox/gfx3d/tests/test_drawer.html
diff options
context:
space:
mode:
authorGravatar mensonge2008-11-13 09:49:11 +0000
committerGravatar mensonge2008-11-13 09:49:11 +0000
commite44a7e37b6c7b5961adaffc62b9042b8d442938e (patch)
tree95b67c356e93163467db2451f2b8cce84ed5d582 /includes/js/dojox/gfx3d/tests/test_drawer.html
parenta62b9742ee5e28bcec6872d88f50f25b820914f6 (diff)
downloadscuttle-e44a7e37b6c7b5961adaffc62b9042b8d442938e.tar.gz
scuttle-e44a7e37b6c7b5961adaffc62b9042b8d442938e.zip
New feature: basic Ajax suggestion for tags and implementation of Dojo toolkit
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@151 b3834d28-1941-0410-a4f8-b48e95affb8f
Diffstat (limited to 'includes/js/dojox/gfx3d/tests/test_drawer.html')
-rw-r--r--includes/js/dojox/gfx3d/tests/test_drawer.html92
1 files changed, 92 insertions, 0 deletions
diff --git a/includes/js/dojox/gfx3d/tests/test_drawer.html b/includes/js/dojox/gfx3d/tests/test_drawer.html
new file mode 100644
index 0000000..3a9af1f
--- /dev/null
+++ b/includes/js/dojox/gfx3d/tests/test_drawer.html
@@ -0,0 +1,92 @@
+<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" >
+<head>
+<title>Pilot test of dojox.gfx3d.</title>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<style type="text/css">
+ @import "../../../dojo/resources/dojo.css";
+ @import "../../../dijit/tests/css/dijitTests.css";
+ @import "../../../dijit/themes/tundra/tundra.css";
+</style>
+<script type="text/javascript" src="../../../dojo/dojo.js" djConfig="isDebug: true"></script>
+<script type="text/javascript">
+
+dojo.require("dojox.gfx3d");
+
+var angles = {x: 0, y: 0, z: 0};
+var view = null;
+var cube = null;
+
+function moveMe(){
+ var p = dojo.byId("action");
+ var m = dojox.gfx3d.matrix;
+ if(p.value == "Move to Back!"){
+ console.debug(p.value);
+ p.value = "Move to Front!";
+ cube.setTransform(m.translate(20, 0, -120))
+ }else{
+ p.value = "Move to Back!";
+ cube.setTransform(m.translate(50, 0, 150))
+ }
+ cube.invalidate();
+ view.render();
+};
+
+makeObjects = function(){
+ var surface = dojox.gfx.createSurface("test", 500, 500);
+ view = surface.createViewport();
+ var c = { bottom: {x: 0, y: 0, z: 0}, top :{x: 100, y: 100, z: 100} };
+ var xaxis = [{x: 0, y: 0, z: 0}, {x: 200, y: 0, z: 0}];
+ var yaxis = [{x: 0, y: 0, z: 0}, {x: 0, y: 200, z: 0}];
+ var zaxis = [{x: 0, y: 0, z: 0}, {x: 0, y: 0, z: 200}];
+
+ var m = dojox.gfx3d.matrix;
+
+ view.createEdges(xaxis).setStroke({color: "red", width: 1});
+ view.createEdges(yaxis).setStroke({color: "green", width: 1});
+ view.createEdges(zaxis).setStroke({color: "blue", width: 1});
+
+ view.createCube(c)
+ .setFill({type: "plastic", finish: dojox.gfx3d.lighting.finish.dull, color: "blue"})
+ .setStroke({color: "black", width: 1});
+
+ cube = view.createCube(c)
+ .setTransform(m.translate(50, 50, 150))
+ .setFill({type: "plastic", finish: dojox.gfx3d.lighting.finish.dull, color: "lime"})
+ .setStroke({color: "black", width: 1});
+
+ var camera = dojox.gfx3d.matrix.normalize([
+ m.cameraRotateXg(60),
+ m.cameraRotateYg(30),
+ m.cameraTranslate(-200, -300, 0)
+ ]);
+
+ view.applyCameraTransform(camera);
+ view.setLights([{direction: {x: 10, y: 7, z: 5}, color: "white"}],
+ {color:"white", intensity: 2}, "white");
+ view.render();
+
+ // add the click event handler
+ dojo.connect(dojo.byId("action"), "onclick", moveMe);
+};
+
+mdebug = function(matrix){
+ var m = dojox.gfx3d.matrix.normalize(matrix);
+ console.debug("xx: " + m.xx + ", xy: " + m.xy + " | xz:" + m.xz + " | dx:" + m.dx);
+ console.debug("yx: " + m.yx + ", yy: " + m.yy + " | yz:" + m.yz + " | dy:" + m.dy);
+ console.debug("zx: " + m.zx + ", zy: " + m.zy + " | zz:" + m.zz + " | dz:" + m.dz);
+};
+
+dojo.addOnLoad(makeObjects);
+
+</script>
+</head>
+<body class="tundra">
+ <h1>Pilot Test</h1>
+ <p> The color of X, Y, Z axes are red, green, blue. One cube is in the center (0, 0, 0), click the button to move the other one back
+ and forth, using this to test <em>dojox.gfx3d.drawer.conservative</em></p>
+ <input id="action" type="button" value="Move to Back!"/>
+
+<div id="test" style="width: 500px; height: 500px;"></div>
+<p>That's all Folks!</p>
+</body>
+</html>