 class Mesh
   constructor: (@name) ->
     @vertices = []
+    @faces = []
     @rotation = Vector3.Zero()
     @position = Vector3.Zero()
 

      # draw yellow
      @putPixel point.x, point.y, new Color4(1, 1, 0, 1)


  # The main method of the engine that recomputes each vertex
  # projection on every frame


      transformMatrix = worldMatrix.multiply(viewMatrix).multiply(projectionMatrix)

      ### Points only ###
      # for vertex in mesh.vertices
      #   @drawPoint @project(vertex, transformMatrix)

      ### Naive line test ###
      # for vertex, i in mesh.vertices[0...-1]
      #   point0 = @project(mesh.vertices[i+0], transformMatrix)
      #   point1 = @project(mesh.vertices[i+1], transformMatrix)
      #   @drawLine(point0, point1)

      for face in mesh.faces
        vertexA = mesh.vertices[face.A]
        vertexB = mesh.vertices[face.B]
        vertexC = mesh.vertices[face.C]
        pixelA = @project(vertexA, transformMatrix)
        pixelB = @project(vertexB, transformMatrix)
        pixelC = @project(vertexC, transformMatrix)
        @drawBLine(pixelA, pixelB)
        @drawBLine(pixelB, pixelC)
        @drawBLine(pixelC, pixelA)


canvas = document.getElementById('front-buffer')
