API documentation is found at: https://peteroupc.github.io/html3dutil

To Use

write the following code in every HTML page where you will use the library.

<script type="text/javascript" src="glutil_min.js"></script>

Include an HTML 3D canvas somewhere on the Web page, since drawing 3D objects requires a 3D canvas. You should set the width and height accordingly. You should also give it an ID so you can refer to it more easily in your JavaScript code, as shown in this example.

<canvas width="640" height="480" id="canvas"></canvas>

To use the HTML 3D library in JavaScript, either add the JavaScript code to the bottom of the page or use an event listener, as in this example:

<script>
window.addEventListener("load",function(){
  var scene=new Scene3D(document.getElementById("canvas"));
  // We have the 3D scene, use it.  (See the example code
  // at the bottom of this article for a more complete example.)
})
</script>

Last edited Apr 30, 2015 at 10:00 PM by peteroupc, version 1