Skip to content

Commit d0f8aae

Browse files
committed
ray example
1 parent a969232 commit d0f8aae

File tree

4 files changed

+432
-1
lines changed

4 files changed

+432
-1
lines changed

examples/Makefile

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ PROGRAMS= \
66
random \
77
primes \
88
msort \
9-
dmm
9+
dmm \
10+
ray
1011

1112
all: $(PROGRAMS)
1213

examples/README.md

+10
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,13 @@ power-of-two. For example:
5151
$ make dmm
5252
$ ./dmm @mpl procs 4 -- -N 1024
5353
```
54+
55+
## Ray Tracing
56+
57+
A simple ray tracer that generates MxN images in PPM format. Use
58+
`-m`/`-n` for output size, `-s` to select a scene, and `-f` to specific
59+
the output file. For example:
60+
```
61+
$ make ray
62+
$ ./ray -f out.ppm -m 400 -n 400 -s irreg
63+
```

examples/src/ray.mlb

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
$(SML_LIB)/basis/basis.mlb
2+
$(SML_LIB)/basis/fork-join.mlb
3+
4+
lib/sources.mlb
5+
ray.sml

0 commit comments

Comments
 (0)