let make_quad ~texture (v0,v1,v2,v3) =
let verticies = v0 :: v1 :: v2 :: v3 :: [] in
object
inherit scene_node
method draw_scene =
let rec each_vertex = function
[] -> ()
| v::vs ->
GlTex.coord2 v.tex ;
GlDraw.normal3 v.normal ;
GlDraw.vertex3 v.vertex ;
each_vertex vs
in
GlTex.bind_texture `texture_2d texture ;
GlDraw.begins `quads ;
each_vertex verticies ;
GlDraw.ends ()
end