exception Error of string
Raised if an OBJ file is ill-formed or if a model has a wrong type
Face | Represents a face of a model |
Vertex | Represents a particular vertex of a model |
This module provides helpers to manipulate and load immutable 3D models in the RAM.
Moreover, the operations provided in this module are generally costly and should not be used in performance-sensitive code.
Models stored in that form are not RAM-friendly, and should not be stored in large numbers. Use vertex arrays instead.
exception Error of string
type t
val empty : t
val from_obj : string -> t
val cube : OgamlMath.Vector3f.t -> OgamlMath.Vector3f.t -> t
val transform : t -> OgamlMath.Matrix3D.t -> t
val scale : t -> OgamlMath.Vector3f.t -> t
val translate : t -> OgamlMath.Vector3f.t -> t
val rotate : t -> OgamlMath.Quaternion.t -> t
val add_face : t -> Face.t -> t
val paint : t -> Color.t -> t
val merge : t -> t -> t
val compute_normals : ?smooth:bool -> t -> t
smooth
is true
, then the normals are computed per-vertex instead of per-face
val simplify : t -> t
val source : t -> ?index_source:IndexArray.Source.t -> vertex_source:VertexArray.SimpleVertex.T.s VertexArray.VertexSource.t -> unit -> unit
val iter : t -> (Face.t -> unit) -> unit
val fold : t -> ('a -> Face.t -> 'a) -> 'a -> 'a
val map : t -> (Face.t -> Face.t) -> t