Skip to content

Commit

Permalink
Examples tweaks, rebuild
Browse files Browse the repository at this point in the history
  • Loading branch information
xeolabs committed Oct 1, 2014
1 parent 0b14950 commit 4bbaa06
Show file tree
Hide file tree
Showing 8 changed files with 177 additions and 1 deletion.
94 changes: 94 additions & 0 deletions api/latest/firstExample.html
Original file line number Diff line number Diff line change
@@ -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>
Binary file added api/latest/plugins.zip
Binary file not shown.
2 changes: 2 additions & 0 deletions api/latest/plugins/node/geometry/quad.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Binary file added api/latest/scenejs.zip.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion examples/geometry_plane.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
yaw:30,
pitch:-30,
zoom:15,
zoomSensitivity:10.0,
zoomSensitivity:2.0,

nodes:[
{
Expand Down
77 changes: 77 additions & 0 deletions examples/geometry_quad.html
Original file line number Diff line number Diff line change
@@ -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>
1 change: 1 addition & 0 deletions examples/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 2 additions & 0 deletions src/plugins/node/geometry/quad.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 4bbaa06

Please sign in to comment.