Module Primitives


module Primitives: sig .. end
Some basic shapes for the scene graph.


type vertex = {
   vertex : float * float * float;
   normal : float * float * float;
   tex : float * float;
}
val make_quad : texture:GlTex.texture_id ->
vertex * vertex * vertex * vertex ->
Scene.scene_node
Returns a new arbitrary quad. The verticies should be on a plane.

draw_scene for quad does not modify the transformation matrix. This means you can call draw_scene on several quads without using GlMat.push and GlMat.pop.

val make_square : texture:GlTex.texture_id -> float -> Scene.scene_node
Returns a new square in the X-Y plane facing along the positive Z axis.

draw_scene does not modify the transformation matrix.

val make_cube : texture:GlTex.texture_id ->
width:float -> height:float -> depth:float -> Scene.scene_node
A rectangular prism centered at the origin. Extends width/2 in each direction on the X axis, height/2 on the Y axis, and depth/2 on the Z axis.

draw_scene does modify the transformation matrix.