WebGL Box


This very simple WebGL scene shows a green box and a red sphere which can be placed anywhere on the surface of the box.

If you click at the box, the red sphere will be placed at that location.

To rotate the box, drag the mouse cursor into the desired direction.


This applet has been programmed in JavaScript and WebGL.

WebGL Box is © Werner Randelshofer. Parts of the code (as marked) are from the WebGL demo repository. This code is copyright by Apple Inc. and by Google Inc. and is used under permission.

If the applet does not display, you may need to use a different browser.
At the time of writing (August 2011) WebGL is supported in Chrome 12, Firefox 5 and in Safari 5.1*.

*You may have to enable WebGL in Safari. See this blog article.


box.zip (33 KB)

Creative Commons Attribution 3.0

External Links

WebGL documentation at Khronos.org

WebGL demo repository.

Copyright © Werner Randelshofer. All Rights Reserved.