Renderer.js 490 B

12345678910111213141516171819202122232425262728293031
  1. "use strict";
  2. /**
  3. * The renderer is resposible for drawing the structure into the canvas element.
  4. *
  5. * Its also resposible for managing the canvas state.
  6. *
  7. * @class
  8. */
  9. function Renderer(canvas)
  10. {
  11. this.canvas = canvas;
  12. }
  13. /**
  14. * Render the object using the viewport into a canvas element.
  15. */
  16. Renderer.render = function(object, viewport)
  17. {
  18. // Update matrixes
  19. this.object.traverse(function(child)
  20. {
  21. });
  22. // Render into the canvas
  23. this.object.traverse(function(child)
  24. {
  25. });
  26. };