<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -167,9 +167,9 @@ $(document).ready(function(){
 			normArray.push(n[2]);
 		
 			// Set some colors
-			colorArray.push(0.2); // R
-			colorArray.push(0.4); // G
-			colorArray.push(0.7); // B
+			colorArray.push(1.0); // R
+			colorArray.push(0.0); // G
+			colorArray.push(0.0); // B
 			colorArray.push(1);	  // A
 		}
 	
@@ -180,26 +180,68 @@ $(document).ready(function(){
 		buffers.color = gl.createBuffer(gl.STATIC_DRAW, 4, gl.FLOAT, colorArray);
 	
 		// Apply the buffers to OpenGL
-		gl.enable(gl.CULL_FACE);
-		gl.frontFace(gl.CCW);
 		gl.vertexPointer(buffers.vertex);
 		gl.normalPointer(buffers.normal);
 		gl.colorPointer(buffers.color);
 	
 		// Flag OpenGL that we will be using buffers
-		gl.enableClientState(gl.VERTEX_ARRAY);
-		gl.enableClientState(gl.NORMAL_ARRAY);
-		gl.enableClientState(gl.COLOR_ARRAY);
 	
 		// Draw
+		//gl.drawArrays(gl.LINES, 0, 14);
+		
 		gl.drawArrays(gl.TRIANGLE_STRIP, 0, 14);
 	
 		// Turn off Buffers
-		gl.disableClientState(gl.VERTEX_ARRAY);
-		gl.disableClientState(gl.NORMAL_ARRAY);
-		gl.disableClientState(gl.COLOR_ARRAY);	
 		
 	}
+	planeObject = function(){
+		this.vertices = [
+			-1,-1,0, 1,-1,0, -1,1,0,
+			-1,1,0, 1,-1,0, 1,1,0,
+
+			1,-1,0, -1,-1,0, -1,1,0,
+			1,-1,0, -1,1,0, 1,1,0,
+		];
+		this.texcoords = [
+			0,1, 1,1, 0,0,
+			0,0, 1,1, 1,0,
+			0,1, 1,1, 1,0,
+		   	0,1, 1,0, 0,0,
+		];
+		this.normals = [
+			0,0,1, 0,0,1, 0,0,1,
+			0,0,1, 0,0,1, 0,0,1,
+			0,0,-1, 0,0,-1, 0,0,-1,
+			0,0,-1, 0,0,-1, 0,0,-1,
+		];
+		this.colors = [
+			1,0,1,1, 0,0,1,1, 1,0,1,1,
+			1,0,1,1, 0,0,1,1, 1,0,1,1,
+			1,0,1,1, 0,0,1,1, 1,0,1,1,
+			1,0,1,1, 0,0,1,1, 1,0,1,1,
+		];
+		this.vertex_buffer = gl.createBuffer(gl.STATIC_DRAW, 3, gl.FLOAT, this.vertices);
+		this.texcoord_buffer = gl.createBuffer(gl.STATIC_DRAW, 2, gl.FLOAT, this.texcoords);
+		this.normal_buffer = gl.createBuffer(gl.STATIC_DRAW, 3, gl.FLOAT, this.normals);
+		this.color_buffer = gl.createBuffer(gl.STATIC_DRAW, 4, gl.FLOAT, this.colors);
+		
+	}
+	
+	var color = function(r, g, b, a){
+		gl.material(gl.FRONT_AND_BACK, gl.AMBIENT, [r, g, b, a]);		
+	}
+
+	plane = new planeObject();
+	var drawplane = function(){
+		gl.vertexPointer(plane.vertex_buffer);
+		gl.texCoordPointer(plane.texcoord_buffer);
+		gl.normalPointer(plane.normal_buffer);
+		gl.colorPointer(plane.color_buffer);
+		// if we are doing wireframe mode
+		// gl.drawArrays(gl.LINES, 0, plane.vertices.length / 3);
+		
+		gl.drawArrays(gl.TRIANGLES, 0, plane.vertices.length / 3);
+	}
 	
 	setInterval(function() {
 		if (document.getElementById('pause').checked)
@@ -207,11 +249,12 @@ $(document).ready(function(){
 
 		// 
 		gl.clearColor(0.1, 0.1, 0.1, 1.0);
-		gl.clear(gl.COLOR_BUFFER_BIT | gl.GL_DEPTH_BUFFER_BIT);
-		
+		gl.clear(gl.DEPTH_BUFFER_BIT | gl.COLOR_BUFFER_BIT);
+		// gl.enable(gl.DEPTH_TEST)
 		// Set the camera in world space
 		// camera.applyToWorld(gl, thisScn);
-		gl.loadIdentity();	
+		
+		gl.loadIdentity();
 		var pos = new Array(5.0, 0.0, -5.0);	
 		var dir = new Array(-5.0, 0.0, 5.0);
 		var left = vectorCrossProduct(dir, new Array(0.0, 1.0, 0.0));
@@ -219,7 +262,9 @@ $(document).ready(function(){
 		
 		gl.multMatrix(lookAt(pos, dir, up));
 		gl.translate(-pos[0], -pos[1], -pos[2]);
-		
+		gl.enableClientState(gl.VERTEX_ARRAY);
+		gl.enableClientState(gl.NORMAL_ARRAY);
+		gl.enableClientState(gl.COLOR_ARRAY);
 		// Do Rendering
 		if(everyframe){
 			everyframe();
@@ -227,6 +272,9 @@ $(document).ready(function(){
 		
 		// Swap buffers to render
 		gl.swapBuffers();
+		gl.disableClientState(gl.VERTEX_ARRAY);
+		gl.disableClientState(gl.NORMAL_ARRAY);
+		gl.disableClientState(gl.COLOR_ARRAY);	
 						
 	}, 30);
 	
@@ -237,10 +285,17 @@ $(document).ready(function(){
 	$(&quot;#run_code&quot;).click(function(){
 		eval($(&quot;#code&quot;).val());
 	});
+	var t = 0;
+	everyframe = function(){
+			gl.rotate(t, 0, 1, 0);
+			drawcube();	
+			gl.translate(-3, 0, 0);
+			drawcube();
+			t++;
+	}
+	
 });
-
 var everyframe = function(){
-	
 }
 window.addEventListener('load', function ()
 {
@@ -263,7 +318,6 @@ if (! window.loaded_first_script)
 &lt;param name=&quot;allowScriptAccess&quot; value=&quot;sameDomain&quot; /&gt;
 &lt;param name=&quot;movie&quot; value=&quot;audioin.swf&quot; /&gt;&lt;param name=&quot;quality&quot; value=&quot;high&quot; /&gt;&lt;param name=&quot;bgcolor&quot; value=&quot;#666666&quot; /&gt;&lt;embed src=&quot;audioin.swf&quot; quality=&quot;high&quot; bgcolor=&quot;#666666&quot; width=&quot;550&quot; height=&quot;138&quot; name=&quot;audioin&quot; align=&quot;middle&quot; allowScriptAccess=&quot;sameDomain&quot; type=&quot;application/x-shockwave-flash&quot; pluginspage=&quot;http://www.macromedia.com/go/getflashplayer&quot; /&gt;
 &lt;/object&gt;
-
 &lt;textarea name=&quot;code&quot; rows=&quot;8&quot; cols=&quot;40&quot; id='code' style='position:absolute;top:0;left:0;border:0;background:none;color:#fff;padding:10px;width:800px;height:600px;'&gt;&lt;/textarea&gt;
 &lt;p id='run_code'&gt;run code&lt;/p&gt;
 &lt;form onsubmit=&quot;flush_buffer(); return false&quot;&gt;</diff>
      <filename>jsxus.html</filename>
    </modified>
    <modified>
      <diff>@@ -7,22 +7,60 @@ var startup = function(){
 		alert(&quot;Sorry, your browser does not have the moz-gles11 canvas extension&quot;);
 		canvas.parentNode.replaceChild(canvas.firstChild, canvas);
 	}else{
+		
 		gl.matrixMode(gl.PROJECTION);
 		gl.loadIdentity();
-		gl.multMatrix(makePerspective(45, canvas.width / canvas.height, 0.1, 200));
-		
+		gl.multMatrix(makePerspective(45, canvas.width / canvas.height, 0.1, 100));
+
 		gl.matrixMode(gl.MODELVIEW);
-		gl.loadIdentity();
-		
-		// Lighting
+
+		gl.clearColor(0.4, 0.1, 0.1, 1);
+
+		// gl.enable(gl.FOG);
+		// gl.fogParameter(gl.FOG_MODE, gl.LINEAR);
+		// gl.fogParameter(gl.FOG_START, 3.7);
+		// gl.fogParameter(gl.FOG_END, 4.5);
+		// gl.fogParameter(gl.FOG_COLOR, background);
+
+		gl.enable(gl.DEPTH_TEST);
+		gl.cullFace(gl.BACK);
+		gl.enable(gl.CULL_FACE);
+
+
 		gl.enable(gl.LIGHTING);
-		gl.light(gl.LIGHT0, gl.AMBIENT, [0.1, 0.1, 0.1, 1.0]);
-		gl.light(gl.LIGHT0, gl.DIFFUSE, [1.0, 1.0, 1.0, 1.0]);
-		gl.light(gl.LIGHT0, gl.SPECULAR, [1.0, 1.0, 1.0, 1.0]);
-		gl.light(gl.LIGHT0, gl.POSITION, [0.0, 270.0, 0.0, 1.0]);
-		gl.light(gl.LIGHT0, gl.SPOT_CUTOFF, 180);
-		gl.light(gl.LIGHT0, gl.SPOT_DIRECTION, [0.0, -1.0, 0.0, 1.0]);
+		gl.light(gl.LIGHT0, gl.AMBIENT, [1, 1, 1, 1]);
+		gl.light(gl.LIGHT0, gl.DIFFUSE, [1, 1, 1, 1]);
+		gl.light(gl.LIGHT0, gl.POSITION, [100, 0, 500, 0]);
+		gl.light(gl.LIGHT0, gl.SPECULAR, [1, 1, 1, 1]);
+		gl.material(gl.FRONT_AND_BACK, gl.SPECULAR, [4,4,4,1]);
+		gl.material(gl.FRONT_AND_BACK, gl.SHININESS, 32);
 		gl.enable(gl.LIGHT0);
-		
+		gl.enableClientState(gl.NORMAL_ARRAY);
+				// 
+				// 
+				// 
+				// 
+				// 
+				// gl.matrixMode(gl.PROJECTION);
+				// gl.multMatrix(makePerspective(45, canvas.width / canvas.height, 0.1, 100));
+				// 
+				// gl.matrixMode(gl.MODELVIEW);
+				// gl.loadIdentity();
+				// gl.enable(gl.CULL_FACE);
+				// gl.frontFace(gl.CCW);
+				// gl.cullFace(gl.BACK);
+				// // gl.enable(gl.DEPTH_TEST);
+				// // gl.cullFace(gl.BACK);
+				// // gl.clearDepth(1.0)
+				// // Lighting
+				// gl.enable(gl.LIGHTING);
+				// gl.light(gl.LIGHT0, gl.AMBIENT, [0.1, 0.1, 0.1, 1.0]);
+				// gl.light(gl.LIGHT0, gl.DIFFUSE, [1.0, 1.0, 1.0, 1.0]);
+				// gl.light(gl.LIGHT0, gl.SPECULAR, [1.0, 1.0, 1.0, 1.0]);
+				// gl.light(gl.LIGHT0, gl.POSITION, [0.0, 270.0, 0.0, 1.0]);
+				// gl.light(gl.LIGHT0, gl.SPOT_CUTOFF, 180);
+				// gl.light(gl.LIGHT0, gl.SPOT_DIRECTION, [0.0, -1.0, 0.0, 1.0]);
+				// gl.enable(gl.LIGHT0);
+				
 	}
 }</diff>
      <filename>startup.js</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>3015123df04d5cac245546add52a1595e4ede1a5</id>
    </parent>
  </parents>
  <author>
    <name>jonbroFERrealz</name>
    <email>jonbro5556@jonathan-brodskys-macbook-pro-15.local</email>
  </author>
  <url>http://github.com/jonbro/jsaxus/commit/c9284d0400d51d6a5add79bb1ccdd0f93f783946</url>
  <id>c9284d0400d51d6a5add79bb1ccdd0f93f783946</id>
  <committed-date>2008-07-14T19:37:05-07:00</committed-date>
  <authored-date>2008-07-14T19:37:05-07:00</authored-date>
  <message>got this back to working. good gawd.
color, depth tests, and the plane object are back in.</message>
  <tree>7682f186a2d6f83f2b3ea83a4f372c8f3908bdde</tree>
  <committer>
    <name>jonbroFERrealz</name>
    <email>jonbro5556@jonathan-brodskys-macbook-pro-15.local</email>
  </committer>
</commit>
