     }
 }
 
-public func renderFlatShaded(model: Mesh, image: Image) {
-    (0..<model.faces.count).forEach { (index) in
-        let face = model.faces[index]
-
-    }
-}
-
 /**
  Projects a 3d coordinate from world space into 2d image space orthographically.
- 
+
  Coordinates will be scaled both horiztonally and vertically to fit the image
  dimensions.
 
  - parameter coordinate: The world-space 3d coordinate to project.
  - parameter image: The image to project into.
+
+ - returns: The projected point.
  */
-
 func screenCoordinateForWorldCoordinate(coordinate: Vector3<Float>, image: Image) -> Point2d<Int> {
     let halfWidth = Float(image.width / 2)
     let halfHeight = Float(image.height / 2)

 */
public func renderWireframe(model: Mesh, image: Image) {
    (0..<model.faces.count).forEach { (index) in
        let face = model.faces[index]
        let vertex1 = model.vertices[face.x]
        let vertex2 = model.vertices[face.y]
        let vertex3 = model.vertices[face.z]

        // 1-2
        let point1 = screenCoordinateForWorldCoordinate(vertex1, image: image)
        let point2 = screenCoordinateForWorldCoordinate(vertex2, image: image)
        drawLine(point1, end: point2, colour: Colour.white(), image: image)

        // 2-3
        let point3 = screenCoordinateForWorldCoordinate(vertex3, image: image)
        drawLine(point2, end: point3, colour: Colour.white(), image: image)

        // 3-1
        drawLine(point3, end: point1, colour: Colour.white(), image: image)
    }
}


    }
}

/**
 Determines if a point is inside a given triangle.

 - parameter triangle: The triangle of interest.
 - parameter point: The point to test.

 - returns: True if the point is inside the given triangle, false if outside.
 */
func triangleContainsPoint(triangle: Triangle<Int>, point: Point2d<Int>) -> Bool {
    let v1 = Vector3(Float(triangle.p3.x - triangle.p1.x), Float(triangle.p2.x - triangle.p1.x), Float(triangle.p1.x - point.x))
    let v2 = Vector3(Float(triangle.p3.y - triangle.p1.y), Float(triangle.p2.y - triangle.p1.y), Float(triangle.p1.y - point.y))
