Home My Page Projects Code Snippets Project Openings 3D graphics for Standard ML
Summary Activity SCM

SCM Repository

[sml3d] View of /trunk/sml3d/src/geometry/gtypes.sml
ViewVC logotype

View of /trunk/sml3d/src/geometry/gtypes.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 766 - (download) (annotate)
Sun Feb 14 16:48:43 2010 UTC (9 years, 8 months ago) by jhr
File size: 771 byte(s)
  Added triangle modules
(* gtypes.sml
 *
 * COPYRIGHT (c) 2010 John Reppy (http://cs.uchicago.edu/~jhr)
 * All rights reserved.
 *
 * To avoid cyclic dependencies in the Module graph, we collect together
 * type definitions for all of the geometric types here.
 *)

structure GTypes =
  struct

    type vec3 = {x : 'flt, y : 'flt, z : 'flt}

    type 'flt ray = {orig : 'flt vec3, dir : 'flt vec3}

    type 'flt sphere = {cx : 'flt, cy : 'flt, cz : 'flt, r : 'flt}

    type 'flt plane = {nx : 'flt, ny : 'flt, nz : 'flt, d : 'flt}

    type 'flt axis_aligned_box = {min : 'flt vec3, max : 'flt vec3}

    type 'flt oriented_box = {}

    type 'flt triangle = {v1 : 'flt vec, v2 : 'flt vec, v3 : 'flt vec}

(* others:
    cylinders
    ellipsoids
    cones
    capsules
    lozenges
*)

  end

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0