aboutsummaryrefslogtreecommitdiff
path: root/demos/webgl
diff options
context:
space:
mode:
Diffstat (limited to 'demos/webgl')
-rw-r--r--demos/webgl/cube1.jpgbin0 -> 12422 bytes
-rw-r--r--demos/webgl/cube2.jpgbin0 -> 13592 bytes
-rw-r--r--demos/webgl/cube3.jpgbin0 -> 14142 bytes
-rw-r--r--demos/webgl/cube4.jpgbin0 -> 15266 bytes
-rw-r--r--demos/webgl/cube5.jpgbin0 -> 15337 bytes
-rw-r--r--demos/webgl/demo.html11
-rw-r--r--demos/webgl/glge.js2
-rw-r--r--demos/webgl/scene.xml14
8 files changed, 22 insertions, 5 deletions
diff --git a/demos/webgl/cube1.jpg b/demos/webgl/cube1.jpg
new file mode 100644
index 00000000..acb2ecce
--- /dev/null
+++ b/demos/webgl/cube1.jpg
Binary files differ
diff --git a/demos/webgl/cube2.jpg b/demos/webgl/cube2.jpg
new file mode 100644
index 00000000..5417aef8
--- /dev/null
+++ b/demos/webgl/cube2.jpg
Binary files differ
diff --git a/demos/webgl/cube3.jpg b/demos/webgl/cube3.jpg
new file mode 100644
index 00000000..43e9edc1
--- /dev/null
+++ b/demos/webgl/cube3.jpg
Binary files differ
diff --git a/demos/webgl/cube4.jpg b/demos/webgl/cube4.jpg
new file mode 100644
index 00000000..4f6739bd
--- /dev/null
+++ b/demos/webgl/cube4.jpg
Binary files differ
diff --git a/demos/webgl/cube5.jpg b/demos/webgl/cube5.jpg
new file mode 100644
index 00000000..9484e64b
--- /dev/null
+++ b/demos/webgl/cube5.jpg
Binary files differ
diff --git a/demos/webgl/demo.html b/demos/webgl/demo.html
index e1eb79ec..39bb8d61 100644
--- a/demos/webgl/demo.html
+++ b/demos/webgl/demo.html
@@ -11,6 +11,10 @@
</head>
<body>
<center>
+ <form onsubmit="run(); return false">
+ <input type="submit" value="restart">
+ </form>
+
<canvas id="canvas" width="500" height="500"></canvas>
<script type="text/javascript">
var doc = new GLGE.Document();
@@ -34,7 +38,7 @@
for (var i = 0; i < 5; i++) {
var box = new GLGE.Object('box_' + i);
box.setMesh(mesh);
- box.setMaterial(doc.getElement("boxmaterial" + (i%2 == 0 ? 1 : 3)));
+ box.setMaterial(doc.getElement("boxmaterial"+(i+1)));
box.setId('box_' + i);
box.setLoc(i*2, 10, 0);
box.setScale(1, 1, 1);
@@ -74,6 +78,11 @@
</script>
<br><br>
<div id="out">waka</div>
+ <br>
+ <b>Bullet/WebGL Demo</b>: The <a href="http://www.bulletphysics.com">Bullet physics engine</a>, compiled from C++ to JavaScript using <a href="http://emscripten.org">Emscripten</a>, with rendering by <a href="http://glge.org">GLGE</a> using WebGL.
+ <br><br>
+ Tested with Firefox 4 nightly builds (minefield) and Chrome 7 (requires --enable-webgl on the commandline); should work with any
+ <a href="http://www.khronos.org/webgl/wiki/Getting_a_WebGL_Implementation">browser that supports WebGL</a>
</center>
</body>
</html>
diff --git a/demos/webgl/glge.js b/demos/webgl/glge.js
index ca19e665..b51f3dcd 100644
--- a/demos/webgl/glge.js
+++ b/demos/webgl/glge.js
@@ -5403,7 +5403,7 @@ GLGE.Renderer=function(canvas,error){
if(!error){
var div=document.createElement("div");
div.setAttribute("style","position: absolute; top: 10px; left: 10px; font-family: sans-serif; font-size: 14px; padding: 10px;background-color: #fcffcb;color: #800; width: 200px; border:2px solid #f00");
- div.innerHTML="Cannot detect webgl please download a compatible browser";
+ div.innerHTML="Cannot detect webgl, please download a <b><a href='http://www.khronos.org/webgl/wiki/Getting_a_WebGL_Implementation'>compatible browser</a></b>";
document.getElementsByTagName("body")[0].appendChild(div);
throw "cannot create webgl context";
}else{
diff --git a/demos/webgl/scene.xml b/demos/webgl/scene.xml
index 06810d04..15aae885 100644
--- a/demos/webgl/scene.xml
+++ b/demos/webgl/scene.xml
@@ -26,17 +26,25 @@
<camera id="maincamera" loc_y="3" loc_z="35"/>
<material id="boxmaterial1">
- <texture id="boxtexture1" src="skin1.jpg"/>
+ <texture id="boxtexture1" src="cube1.jpg"/>
<material_layer texture="#boxtexture1" mapinput="UV1" mapto="M_COLOR"/>
</material>
<material id="boxmaterial2">
- <texture id="boxtexture2" src="skin2.jpg"/>
+ <texture id="boxtexture2" src="cube2.jpg"/>
<material_layer texture="#boxtexture2" mapinput="UV1" mapto="M_COLOR"/>
</material>
<material id="boxmaterial3">
- <texture id="boxtexture3" src="skin3.jpg"/>
+ <texture id="boxtexture3" src="cube3.jpg"/>
<material_layer texture="#boxtexture3" mapinput="UV1" mapto="M_COLOR"/>
</material>
+ <material id="boxmaterial4">
+ <texture id="boxtexture4" src="cube4.jpg"/>
+ <material_layer texture="#boxtexture4" mapinput="UV1" mapto="M_COLOR"/>
+ </material>
+ <material id="boxmaterial5">
+ <texture id="boxtexture5" src="cube5.jpg"/>
+ <material_layer texture="#boxtexture5" mapinput="UV1" mapto="M_COLOR"/>
+ </material>
<scene id="mainscene" camera="#maincamera" ambient_color="#fff">
<!--light id="mainlight" loc_y="5" type="L_POINT"/-->