mirror of
https://github.com/c-cube/moonpool.git
synced 2025-12-06 11:15:38 -05:00
Remove main for now
This commit is contained in:
parent
2d940e4c5e
commit
7b01a47c16
1 changed files with 0 additions and 37 deletions
|
|
@ -130,40 +130,3 @@ let write_to_file filename =
|
||||||
done;
|
done;
|
||||||
Out_channel.close oc;
|
Out_channel.close oc;
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
|
||||||
let main() =
|
|
||||||
let nx = 200 in
|
|
||||||
let ny = 100 in
|
|
||||||
print_string "P3\n";
|
|
||||||
printf "%d\n" nx;
|
|
||||||
printf "%d\n" ny;
|
|
||||||
print_string "\n255\n";
|
|
||||||
|
|
||||||
let lower_left_corner = Vec3.of_floats (-2., -1., -1.) in
|
|
||||||
let horizontal = Vec3.of_floats (4., 0., 0.) in
|
|
||||||
let vertical = Vec3.of_floats (0., 2., 0.) in
|
|
||||||
let origin = Vec3.of_floats (0., 0., 0.) in
|
|
||||||
let color = ref {x=0.; y=0.; z=0.} in
|
|
||||||
for j = ny downto 1 do
|
|
||||||
for i = 0 to nx-1 do
|
|
||||||
let u = (Float.of_int i) /. (Float.of_int nx) in
|
|
||||||
let v = (Float.of_int j) /. (Float.of_int ny) in
|
|
||||||
|
|
||||||
let r = { origin = origin;
|
|
||||||
dir = Vec3.add lower_left_corner (Vec3.add (Vec3.mul u horizontal) (Vec3.mul v vertical)) } in
|
|
||||||
color := get_color r;
|
|
||||||
|
|
||||||
let {x=r; y=g; z=b} = !color in
|
|
||||||
let (ir, ig, ib) = (Int.of_float (r*.255.99),
|
|
||||||
Int.of_float (g*.255.99),
|
|
||||||
Int.of_float (b*.255.99)) in
|
|
||||||
printf "%d " ir;
|
|
||||||
printf "%d " ig;
|
|
||||||
printf "%d " ib;
|
|
||||||
print_newline();
|
|
||||||
done
|
|
||||||
done
|
|
||||||
;;
|
|
||||||
|
|
||||||
(* main() *)
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue