aboutsummaryrefslogtreecommitdiff
path: root/js/lib/drawing
diff options
context:
space:
mode:
authorhwc4872012-05-22 08:38:38 -0700
committerhwc4872012-05-22 08:38:38 -0700
commitcc3b66f817c9d72ca247d5ff789a08ec5b57a2b5 (patch)
tree229a3d92b2fa86c32b6d47134b843880e909bead /js/lib/drawing
parentdc92188fef67d7a2032173d7746fbc16a951a366 (diff)
downloadninja-cc3b66f817c9d72ca247d5ff789a08ec5b57a2b5.tar.gz
Editable material properties
Diffstat (limited to 'js/lib/drawing')
-rwxr-xr-xjs/lib/drawing/world.js20
1 files changed, 10 insertions, 10 deletions
diff --git a/js/lib/drawing/world.js b/js/lib/drawing/world.js
index 14e63f4a..3c93b2b7 100755
--- a/js/lib/drawing/world.js
+++ b/js/lib/drawing/world.js
@@ -180,14 +180,14 @@ var World = function GLWorld( canvas, use3D, preserveDrawingBuffer ) {
180 180
181 // create some lights 181 // create some lights
182 // light 1 182 // light 1
183 this.light = RDGE.createLightNode("myLight"); 183// this.light = RDGE.createLightNode("myLight");
184 this.light.setPosition([0,0,1.2]); 184// this.light.setPosition([0,0,1.2]);
185 this.light.setDiffuseColor([0.75,0.9,1.0,1.0]); 185// this.light.setDiffuseColor([0.75,0.9,1.0,1.0]);
186 186
187 // light 2 187 // light 2
188 this.light2 = RDGE.createLightNode("myLight2"); 188// this.light2 = RDGE.createLightNode("myLight2");
189 this.light2.setPosition([-0.5,0,1.2]); 189// this.light2.setPosition([-0.5,0,1.2]);
190 this.light2.setDiffuseColor([1.0,0.9,0.75,1.0]); 190// this.light2.setDiffuseColor([1.0,0.9,0.75,1.0]);
191 191
192 // create a light transform 192 // create a light transform
193 var lightTr = RDGE.createTransformNode("lightTr"); 193 var lightTr = RDGE.createTransformNode("lightTr");
@@ -196,8 +196,8 @@ var World = function GLWorld( canvas, use3D, preserveDrawingBuffer ) {
196 lightTr.attachMaterial(RDGE.createMaterialNode("lights")); 196 lightTr.attachMaterial(RDGE.createMaterialNode("lights"));
197 197
198 // enable light channels 1, 2 - channel 0 is used by the default shader 198 // enable light channels 1, 2 - channel 0 is used by the default shader
199 lightTr.materialNode.enableLightChannel(1, this.light); 199// lightTr.materialNode.enableLightChannel(1, this.light);
200 lightTr.materialNode.enableLightChannel(2, this.light2); 200// lightTr.materialNode.enableLightChannel(2, this.light2);
201 201
202 // all added objects are parented to the light node 202 // all added objects are parented to the light node
203 this._rootNode = lightTr; 203 this._rootNode = lightTr;
@@ -225,8 +225,8 @@ var World = function GLWorld( canvas, use3D, preserveDrawingBuffer ) {
225 RDGE.rdgeGlobalParameters.u_light0Pos.set([5 * Math.cos(this.elapsed), 5 * Math.sin(this.elapsed), 20]); 225 RDGE.rdgeGlobalParameters.u_light0Pos.set([5 * Math.cos(this.elapsed), 5 * Math.sin(this.elapsed), 20]);
226 226
227 // orbit the light nodes around the boxes 227 // orbit the light nodes around the boxes
228 this.light.setPosition([1.2*Math.cos(this.elapsed*2.0), 1.2*Math.sin(this.elapsed*2.0), 1.2*Math.cos(this.elapsed*2.0)]); 228// this.light.setPosition([1.2*Math.cos(this.elapsed*2.0), 1.2*Math.sin(this.elapsed*2.0), 1.2*Math.cos(this.elapsed*2.0)]);
229 this.light2.setPosition([-1.2*Math.cos(this.elapsed*2.0), 1.2*Math.sin(this.elapsed*2.0), -1.2*Math.cos(this.elapsed)]); 229// this.light2.setPosition([-1.2*Math.cos(this.elapsed*2.0), 1.2*Math.sin(this.elapsed*2.0), -1.2*Math.cos(this.elapsed)]);
230 } 230 }
231 231
232 this.updateMaterials( this.getGeomRoot(), this.elapsed ); 232 this.updateMaterials( this.getGeomRoot(), this.elapsed );