Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Annotation of /sml/trunk/benchmarks/programs/ray/objects.sml
ViewVC logotype

Annotation of /sml/trunk/benchmarks/programs/ray/objects.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 193 - (view) (download)

1 : monnier 193 (* objects.sml
2 :     *
3 :     * COPYRIGHT (c) 1992 AT&T Bell Laboratories
4 :     *
5 :     * Type declarations for the various objects in the ray tracer.
6 :     *)
7 :    
8 :     structure Objects =
9 :     struct
10 :    
11 :     datatype point = PT of {x : real, y : real, z : real}
12 :    
13 :     datatype vector = VEC of {l : real, m : real, n : real}
14 :    
15 :     datatype ray = Ray of {s : point, d : vector}
16 :    
17 :     datatype camera = Camera of {
18 :     vp : point,
19 :     ul : point,
20 :     ur : point,
21 :     ll : point,
22 :     lr : point
23 :     }
24 :    
25 :     datatype color = Color of {red : real, grn : real, blu : real}
26 :    
27 :     datatype sphere = Sphere of {c : point, r : real, color : color}
28 :    
29 :     datatype hit = Miss | Hit of {t : real, s : sphere}
30 :    
31 :     datatype visible = Visible of {h : point, s : sphere}
32 :    
33 :     datatype object
34 :     = TOP
35 :     | NUMBER of real
36 :     | NAME of string
37 :     | LIST of object list
38 :     | OPERATOR of object list -> object list
39 :     | MARK
40 :     | LITERAL of string
41 :     | UNMARK
42 :     | POINT of point
43 :     | VECTOR of vector
44 :     | RAY of ray
45 :     | CAMERA of camera
46 :     | COLOR of color
47 :     | SPHERE of sphere
48 :     | HIT
49 :     | VISIBLE
50 :    
51 :     end (* Objects *)

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