forked from xeolabs/scenejs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
133 additions
and
225 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
<!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 { | ||
margin: 0; | ||
-moz-user-select: -moz-none; | ||
-khtml-user-select: none; | ||
-webkit-user-select: none; | ||
} | ||
</style> | ||
|
||
<script src="../../../build/latest/scenejs.js"></script> | ||
<script src="../../../build/latest/extras/orbitControl.js"></script> | ||
</head> | ||
<body> | ||
|
||
<script> | ||
|
||
// Demonstrates how to enable and disable specular lighting for geometry. | ||
// | ||
// Specularity is governed by light nodes working in conjunction with | ||
// specular surface color defined by material nodes. | ||
// | ||
// With SceneJS' default lighting in effect, the 'specular' attribute | ||
// of the flags node in the example below will govern whether or not specular | ||
// light is applied to the geometry in its subgraph. | ||
// | ||
// As we periodically toggle the attribute, watch the specular highlights | ||
// appear and disappear on the geometry accordingly. | ||
// | ||
// Specular lighting will be enabled by default when no flags node | ||
// is present, or if the 'specular' flag is not specified and | ||
// defaults to true. | ||
// | ||
|
||
var scene = SceneJS.createScene({ | ||
nodes:[ | ||
|
||
// Override SceneJS' default lights to make specular reflection look nice | ||
// for this example | ||
{ | ||
type:"lights", | ||
lights:[ | ||
{ | ||
mode:"ambient", | ||
color:{ r:0.7, g:0.7, b:0.8 }, | ||
diffuse:true, | ||
specular:false | ||
}, | ||
{ | ||
mode:"dir", | ||
color:{ r:0.5, g:0.5, b:1.0 }, | ||
diffuse:true, | ||
specular:true, | ||
dir:{ x:0.5, y:0.5, z:-1.0 }, | ||
space:"view" | ||
} | ||
], | ||
|
||
nodes:[ | ||
|
||
// Our flags can be anywhere above the geometry | ||
// we want to toggle specularity for | ||
{ | ||
type:"flags", | ||
id:"myFlags", | ||
flags:{ | ||
specular:true // (default is true) | ||
}, | ||
|
||
nodes:[ | ||
|
||
// Some specular material | ||
{ | ||
type:"material", | ||
color:{ r:0.5, g:0.5, b:0.6 }, | ||
specularColor:{ r:0.7, g:0.7, b:0.8 }, | ||
specular:1.0, | ||
shine:5.0, | ||
|
||
nodes:[ | ||
|
||
// A specular map for completeness | ||
{ | ||
type:"texture", | ||
id:"theTexture", | ||
layers:[ | ||
{ | ||
src:"../../textures/crossGridSpecularMap.jpg", | ||
applyTo:"specular", | ||
blendMode:"multiply" | ||
} | ||
], | ||
nodes:[ | ||
{ | ||
type:"geometry", | ||
plugin:"torus" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
}); | ||
|
||
new SceneJS.OrbitControls(scene, { | ||
yaw:30, | ||
pitch:-30, | ||
zoom:5 | ||
}); | ||
|
||
var flags = scene.getNode("myFlags"); | ||
|
||
setInterval( | ||
function () { | ||
flags.setSpecular(!flags.getSpecular()); | ||
}, | ||
1000); | ||
|
||
</script> | ||
</body> | ||
</html> |
225 changes: 0 additions & 225 deletions
225
examples/ex/transforms/dynamicTransformHierarchyOLD.html
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
//SceneJS.configure({ pluginPath: "http://xeolabs.github.com/scenejs/build/latest/plugins" }); | ||
SceneJS.configure({ pluginPath: "/home/lindsay/xeolabs/projects/scenejs3.0/build/latest/plugins" }); |