diff --git a/api/latest/firstExample.html b/api/latest/firstExample.html new file mode 100644 index 00000000..bedadbc4 --- /dev/null +++ b/api/latest/firstExample.html @@ -0,0 +1,94 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <title>SceneJS First Example</title> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"> + + <style> + body { + margin: 0; + -moz-user-select: -moz-none; + -khtml-user-select: none; + -webkit-user-select: none; + } + </style> + + <script src="./scenejs.js"></script> + +</head> +<body> + +<script> + + //------------------------------------------------------------------------------------------------------------------ + // A SceneJS minimal boilerplate to get you started + // + // Some resources you might need: + // + // Getting started: http://xeolabs.com/articles/scenejs-quick-start/ + // Examples: http://scenejs.org/examples/index.html + // Tutorials: http://xeolabs.com + // + // Right, off you go - make something wicked! + //------------------------------------------------------------------------------------------------------------------ + + + // Point SceneJS to the bundled plugins + SceneJS.setConfigs({ + pluginPath:"./plugins" + }); + + + // Define scene + var scene = SceneJS.createScene({ + nodes:[ + { + type:"lookAt", + eye:{ y:5, z:7 }, + look:{ x:0, y:1, z:0 }, + + nodes:[ + { + type:"material", + color:{ r:0.3, g:0.3, b:1.0 }, + + nodes:[ + { + type:"rotate", + id:"myRotate", + y:1.0, + angle:0, + + nodes:[ + + // Teapot primitive, implemented by plugin at + // http://scenejs.org/api/latest/plugins/node/geometry/teapot.js + { + type:"geometry/teapot" + } + ] + } + ] + } + ] + } + ] + }); + + + // On each frame, spin the teapot a little bit + scene.getNode("myRotate", + function (myRotate) { + + var angle = 0; + + scene.on("tick", + function () { + myRotate.setAngle(angle += 0.5); + }); + }); + +</script> +</body> +</html> diff --git a/api/latest/plugins.zip b/api/latest/plugins.zip new file mode 100644 index 00000000..d4666470 Binary files /dev/null and b/api/latest/plugins.zip differ diff --git a/api/latest/plugins/node/geometry/quad.js b/api/latest/plugins/node/geometry/quad.js index 1b68f9e1..e64d6bec 100644 --- a/api/latest/plugins/node/geometry/quad.js +++ b/api/latest/plugins/node/geometry/quad.js @@ -22,6 +22,8 @@ function build(params) { + // TODO: support size properties like 'geometry/plane' + var coreId = "geometry/quad" + (params.wire ? "wire" : "_solid"); // If a node core already exists for a prim with the given properties, diff --git a/api/latest/scenejs.zip.zip b/api/latest/scenejs.zip.zip new file mode 100644 index 00000000..3e7b3f03 Binary files /dev/null and b/api/latest/scenejs.zip.zip differ diff --git a/examples/geometry_plane.html b/examples/geometry_plane.html index 1bc70f78..7edf1001 100644 --- a/examples/geometry_plane.html +++ b/examples/geometry_plane.html @@ -42,7 +42,7 @@ yaw:30, pitch:-30, zoom:15, - zoomSensitivity:10.0, + zoomSensitivity:2.0, nodes:[ { diff --git a/examples/geometry_quad.html b/examples/geometry_quad.html new file mode 100644 index 00000000..d5cfbf49 --- /dev/null +++ b/examples/geometry_quad.html @@ -0,0 +1,77 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <title>SceneJS Example</title> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"> + + <style> + body { + background: white; + margin: 0; + -moz-user-select: -moz-none; + -khtml-user-select: none; + -webkit-user-select: none; + } + </style> + + <script src="../api/latest/scenejs.js"></script> + <link href="css/styles.css" rel="stylesheet"/> + +<body> + +<div id="infoDark"> + <a href="http://scenejs.org">SceneJS</a> - <a href="../api/latest/plugins/node/geometry/quad.js" target="_other">quad</a> + geometry +</div> + +<script> + + // Point SceneJS to the bundled plugins + SceneJS.setConfigs({ + pluginPath: "../api/latest/plugins" + }); + + // Create scene + SceneJS.createScene({ + nodes: [ + + // Mouse-orbited camera, implemented by plugin at + // http://scenejs.org/api/latest/plugins/node/cameras/orbit.js + { + type: "cameras/orbit", + yaw: 30, + pitch: -30, + zoom: 30, + zoomSensitivity: 2.0, + + nodes: [ + { + type: "material", + color: { r: 0.6, g: 0.6, b: 0.9 }, + nodes: [ + + { + type: "scale", + x: 10, y: 10, z: 10, + + nodes: [ + + // Quad primitive, implemented by plugin at + // http://scenejs.org/api/latest/plugins/node/geometry/quad.js + // TODO: support size properties like 'geometry/plane' + { + type: "geometry/quad" + } + ] + } + ] + } + ] + } + ] + }); + +</script> +</body> +</html> \ No newline at end of file diff --git a/examples/index.html b/examples/index.html index 76499732..0d0f78b7 100644 --- a/examples/index.html +++ b/examples/index.html @@ -249,6 +249,7 @@ <h1><a href="../index.html">SceneJS</a> / Examples</h1> "geometry_box", "geometry_cylinder", "geometry_plane", + "geometry_quad", "geometry_sphere", "geometry_teapot", "geometry_torus", diff --git a/src/plugins/node/geometry/quad.js b/src/plugins/node/geometry/quad.js index 1b68f9e1..e64d6bec 100644 --- a/src/plugins/node/geometry/quad.js +++ b/src/plugins/node/geometry/quad.js @@ -22,6 +22,8 @@ function build(params) { + // TODO: support size properties like 'geometry/plane' + var coreId = "geometry/quad" + (params.wire ? "wire" : "_solid"); // If a node core already exists for a prim with the given properties,