Permalink
Browse files

bullet/webgl demo tweaks

  • Loading branch information...
1 parent 8c8baae commit 1b09fdf1dbc7909139de406e5e7bbc30bc65ea8f @azakai azakai committed Nov 10, 2010
View
BIN demos/webgl/cube1.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN demos/webgl/cube2.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN demos/webgl/cube3.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN demos/webgl/cube4.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN demos/webgl/cube5.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
11 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>
View
2 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{
View
14 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"/-->

0 comments on commit 1b09fdf

Please sign in to comment.