Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace Boo:Primitive:
- class Mesh
- constructor: (@coord) ->
- @cam = 1
- draw: (ctx) ->
- ctx.beginPath()
- ctx.moveTo @cnv(@coord[2], 0), @cnv(@coord[2], 1)
- for i in [0..2]
- ctx.lineTo @cnv(@coord[i], 0), @cnv(@coord[i], 1)
- ctx.stroke()
- ctx.closePath()
- cnv: (elem, num) ->
- fov = 4 - num
- 4 * elem[num] / (elem[2] - @cam)
- Ioc::bind Boo.Primitive.Mesh
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement