     return Vec2.fromValues(x, y)
 
   # drawPoint calls putPixel but does the clipping operation before
-  drawPoint: (point) ->
+  drawPoint: (point, color) ->
+    color ||= Vec4.fromValues(1, 1, 1, 1)
     # Clipping what's visible on screen
     if 0 <= point[0] < @canvas.width && 0 <= point[1] < @canvas.height
       # draw white
-      @putPixel point[0], point[1], {r:1, g:1, b:1, a:1}
+      @putPixel point[0], point[1], color
 
   drawLine: (p0, p1) ->
     p0p1 = Vec2.subtract(Vec2.create(), p1, p0)

    index = ((x >> 0) + (y >> 0) * @canvas.width) * 4

    # RGBA color space is used by the HTML5 canvas
    @backbufferdata[index + 0] = color.r * 255
    @backbufferdata[index + 1] = color.g * 255
    @backbufferdata[index + 2] = color.b * 255
    @backbufferdata[index + 3] = color.a * 255

  # Project takes some 3D coordinates and transforms them in 2D
  # coordinates using the transformation matrix

        err += dx
        y0 += sy

  drawScanLine: (x1, x2, y, color) ->
    [x1, x2] = [x2, x1] if x1 > x2
    for x in [(x1 | 0)..(x2 | 0)] by 1
      @drawPoint(Vec2.fromValues(x, y), color)

  # The main method of the engine that recomputes each vertex
  # projection on every frame
  render: (camera, meshes) ->
