Skip to content

Commit

Permalink
Removed boundingBox nodes, fixed normals and updated examples
Browse files Browse the repository at this point in the history
  • Loading branch information
xeolabs committed May 4, 2011
1 parent 1e4fe96 commit 1f78baf
Show file tree
Hide file tree
Showing 67 changed files with 990 additions and 2,670 deletions.
14 changes: 9 additions & 5 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,22 @@ for model and data visualisation systems.
Some key features:

* flexible JSON API for scene graph create/update/query
* messaging system for peer-to-peer commands to the JSON API
* automatic GLSL generation - fully encapsulated
* message system
* automatic internal GLSL generation
* IoC container
* GL state sorting
* bounding boxes
* LOD
* flexible data flows
* interpolated animation
* morphing
* branching
* instancing
* text
* animated textures
* rendering to textures
* color, specular, glow, transparency and bump mapping
* arbitrarily-aligned clipping planes
* multimaterials
* material atlasses
* render order layers
* debugging modes
* and more..

Expand Down
12 changes: 0 additions & 12 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,6 @@

<fileset dir="${SRC_DIR}" includes="scenejs/interpolation/interpolator.js"/>

<fileset dir="${SRC_DIR}" includes="scenejs/boundary/viewFrustumModule.js"/>
<fileset dir="${SRC_DIR}" includes="scenejs/boundary/viewLocalityModule.js"/>
<fileset dir="${SRC_DIR}" includes="scenejs/boundary/boundingBox.js"/>
<fileset dir="${SRC_DIR}" includes="scenejs/boundary/boundaryModule.js"/>
<fileset dir="${SRC_DIR}" includes="scenejs/boundary/locality.js"/>

<fileset dir="${SRC_DIR}" includes="scenejs/texture/textureModule.js"/>
<fileset dir="${SRC_DIR}" includes="scenejs/texture/textureLayer.js"/>
<fileset dir="${SRC_DIR}" includes="scenejs/texture/texture.js"/>
Expand Down Expand Up @@ -261,12 +255,6 @@

<fileset dir="${SRC_DIR}" includes="scenejs/interpolation/interpolator.js"/>

<fileset dir="${SRC_DIR}" includes="scenejs/boundary/viewFrustumModule.js"/>
<fileset dir="${SRC_DIR}" includes="scenejs/boundary/viewLocalityModule.js"/>
<fileset dir="${SRC_DIR}" includes="scenejs/boundary/boundingBox.js"/>
<fileset dir="${SRC_DIR}" includes="scenejs/boundary/boundaryModule.js"/>
<fileset dir="${SRC_DIR}" includes="scenejs/boundary/locality.js"/>

<fileset dir="${SRC_DIR}" includes="scenejs/texture/textureModule.js"/>
<fileset dir="${SRC_DIR}" includes="scenejs/texture/textureLayer.js"/>
<fileset dir="${SRC_DIR}" includes="scenejs/texture/texture.js"/>
Expand Down
261 changes: 130 additions & 131 deletions resources/example-index-p2.html

Large diffs are not rendered by default.

59 changes: 10 additions & 49 deletions src/examples/animated-texture/animated-texture.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
/**
* Animated texture example
* Texture sampled from 2D canvas
*
* Lindsay Kay
* lindsay.kay AT xeolabs.com
* January 2010
*
*/

/*----------------------------------------------------------------------
* Scene graph definition
*---------------------------------------------------------------------*/

SceneJS.createNode({
type: "scene",
Expand All @@ -19,7 +16,7 @@ SceneJS.createNode({
nodes: [
{
type: "lookAt",
eye : { x: 0.0, y: 0.0, z: -10},
eye : { x: 0.0, y: 0.0, z: 10},
look : { x : 0.0, y : 0.0, z : 0 },
up : { x: 0.0, y: 1.0, z: 0.0 },

Expand All @@ -32,32 +29,24 @@ SceneJS.createNode({
aspect : 1.47,
near : 0.10,
far : 300.0
},
},

nodes: [
{
type: "light",
mode: "dir",
color: { r: 1.0, g: 0.5, b: 0.5 },
mode: "dir",
color: { r: 1.0, g: 1.0, b: 1.0 },
diffuse: true,
specular: true,
dir: { x: 1.0, y: 1.0, z: -1.0 }
dir: { x: 1.0, y: -0.5, z: -1.0 }
},
{
type: "light",
mode: "dir",
color: { r: 0.5, g: 1.0, b: 0.5 },
mode: "dir",
color: { r: 0.7, g: 0.7, b: 0.7 },
diffuse: true,
specular: true,
dir: { x: 0.0, y: 1.0, z: -1.0 }
},
{
type: "light",
mode: "dir",
color: { r: 0.2, g: 0.2, b: 1.0 },
diffuse: true,
specular: true,
dir: { x: -1.0, y: 0.0, z: -1.0 }
dir: { x: 1.0, y: 0.5, z: -1.0 }
},
{
type: "material",
Expand All @@ -67,22 +56,11 @@ SceneJS.createNode({
shine: 10.0,

nodes: [


/** Textures images are loaded asynchronously and won't render
* immediately. On first traversal, they start loading their image,
* which they collect on a subsequent traversal.
*/
{
type: "texture",

id: "theTexture",

/* A texture can have multiple layers, each applying an
* image to a different material reflection component.
* This layer applies the Zod image to the diffuse
* component, with animated scaling.
*/
layers: [
{
uri:"general-zod.jpg",
Expand Down Expand Up @@ -156,23 +134,6 @@ SceneJS.createNode({
]
});

/*----------------------------------------------------------------------
* Enable scene graph compilation (disabled by default in V0.8).
*
* This feature is alpha status and may break some scene graphs.
*
* It can speed your scene graph up by an order of magnitude - we'll
* do it here just to show how it's done.
*
* http://scenejs.wikispaces.com/V0.8+Branch
*---------------------------------------------------------------------*/

SceneJS.setDebugConfigs({
compilation : {
enabled : true
}
});

/*----------------------------------------------------------------------
* Scene rendering loop and mouse handler stuff
*---------------------------------------------------------------------*/
Expand Down Expand Up @@ -205,7 +166,7 @@ function mouseUp() {
function mouseMove(event) {
if (dragging) {
yaw += (event.clientX - lastX) * 0.5;
pitch += (event.clientY - lastY) * -0.5;
pitch += (event.clientY - lastY) * 0.5;
lastX = event.clientX;
lastY = event.clientY;

Expand Down
39 changes: 7 additions & 32 deletions src/examples/basic-picking/basic-picking.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ SceneJS.createNode({
nodes: [
{
type: "lookAt",
eye : { x: 0, y: 2, z: -22},
eye : { x: 0, y: 2, z: 22},
look : { x : 0.0, y : -1.0, z : 0 },
up : { x: 0.0, y: 1.0, z: 0.0 },

Expand All @@ -38,29 +38,21 @@ SceneJS.createNode({
},

nodes: [
{
{
type: "light",
mode: "dir",
mode: "dir",
color: { r: 1.0, g: 1.0, b: 1.0 },
diffuse: true,
specular: true,
dir: { x: 1.0, y: 1.0, z: -1.0 }
},
{
type: "light",
mode: "dir",
color: {r: 1.0, g: 1.0, b: 1.0},
diffuse: true,
specular: true,
dir: { x: 0.0, y: 1.0, z: -1.0 }
dir: { x: 1.0, y: -0.5, z: -1.0 }
},
{
type: "light",
mode: "dir",
color: {r: 1.0, g: 1.0, b: 1.0},
mode: "dir",
color: { r: 0.7, g: 0.7, b: 0.7 },
diffuse: true,
specular: true,
dir: { x: -1.0, y: 0.0, z: -1.0 }
dir: { x: 1.0, y: 0.5, z: -1.0 }
},
{
type: "node",
Expand Down Expand Up @@ -234,23 +226,6 @@ SceneJS.createNode({
]
});

/*----------------------------------------------------------------------
* Enable scene graph compilation (disabled by default in V0.8).
*
* This feature is alpha status and may break some scene graphs.
*
* It can speed your scene graph up by an order of magnitude - we'll
* do it here just to show how it's done.
*
* http://scenejs.wikispaces.com/V0.8+Branch
*---------------------------------------------------------------------*/

SceneJS.setDebugConfigs({
compilation : {
enabled : true
}
});


/* We can observe when nothing is picked with a "notpicked"
* listener attached to the scene node:
Expand Down
39 changes: 11 additions & 28 deletions src/examples/billboard/billboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ SceneJS.createNode({
nodes: [
{
type: "lookAt",
eye : { x: 0, y: 1, z: -25 },
eye : { x: 0, y: 1, z: 25 },
look : { x: 0, y: 1, z: 0 },
up : { y: 1.0 },

Expand All @@ -64,19 +64,19 @@ SceneJS.createNode({
nodes: [
{
type: "light",
mode: "dir",
color: { r: 1, g: 1, b: 1 },
dir: {x:0, y:4, z:5},
diffuse: true,
specular: false
mode: "dir",
color: { r: 1.0, g: 1.0, b: 1.0 },
diffuse: true,
specular: true,
dir: { x: 1.0, y: -0.5, z: -1.0 }
},
{
type: "light",
mode: "dir",
color: { r: 1, g: 1, b: 1 },
dir: {x:0, y:4, z:-5},
diffuse: true,
specular: false
mode: "dir",
color: { r: 1.0, g: 1.0, b: 1.0 },
diffuse: true,
specular: true,
dir: { x: 1.0, y: -1.0, z: -1.0 }
},
{
type: "rotate",
Expand Down Expand Up @@ -145,23 +145,6 @@ SceneJS.createNode({
]
});

/*----------------------------------------------------------------------
* Enable scene graph compilation (disabled by default in V0.8).
*
* This feature is alpha status and may break some scene graphs.
*
* It can speed your scene graph up by an order of magnitude - we'll
* do it here just to show how it's done.
*
* http://scenejs.wikispaces.com/V0.8+Branch
*---------------------------------------------------------------------*/

SceneJS.setDebugConfigs({
compilation : {
enabled : true
}
});

/*----------------------------------------------------------------------
* Scene rendering loop and mouse handler stuff follows
*---------------------------------------------------------------------*/
Expand Down
22 changes: 7 additions & 15 deletions src/examples/bump-mapping/bump-mapping.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,29 +37,21 @@ SceneJS.createNode({
nodes: [
{
type: "light",
mode: "dir",
color: { r: 1.0, g: 0.5, b: 0.5 },
mode: "dir",
color: { r: 1.0, g: 1.0, b: 1.0 },
diffuse: true,
specular: true,
dir: { x: 1.0, y: 1.0, z: -1.0 }
dir: { x: 1.0, y: -0.5, z: -1.0 }
},
{
type: "light",
mode: "dir",
color: { r: 0.5, g: 1.0, b: 0.5 },
mode: "dir",
color: { r: 1.0, g: 1.0, b: 1.0 },
diffuse: true,
specular: true,
dir: { x: 0.0, y: 1.0, z: -1.0 }
dir: { x: 1.0, y: -1.0, z: -1.0 }
},
{
type: "light",
mode: "dir",
color: { r: 0.2, g: 0.2, b: 1.0 },
diffuse: true,
specular: true,
dir: { x: -1.0, y: 0.0, z: -1.0 }
},


/* Material properties
*/
{
Expand Down
Loading

0 comments on commit 1f78baf

Please sign in to comment.