-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_raytracing_cornellbox.gisp
More file actions
40 lines (32 loc) · 1.33 KB
/
Copy pathtest_raytracing_cornellbox.gisp
File metadata and controls
40 lines (32 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
(def sw 256)
(def sh 256)
(def spp 128)
;;Define scene
(def scene (make-group3D))
(def lights (make-group3D))
;;Define materials
(def metal (make-material-metal 0.8 0.85 0.88 0.1))
(def glass (make-material-dielectric 1.5))
(def red (make-material-lambertian 0.65 0.05 0.05))
(def whi (make-material-lambertian 0.73 0.73 0.73))
(def gre (make-material-lambertian 0.12 0.45 0.15))
(def lig (make-material-light 15 15 15))
;;Make cornel box
(add-to-group3D scene (rect3D [ 0 0 0] [ 0 555 555] gre))
(add-to-group3D scene (rect3D [555 0 0] [555 555 555] red))
(def testlight (flip-face (rect3D [213 554 277] [343 554 332] lig)))
(add-to-group3D scene testlight)
(add-to-group3D lights testlight)
(add-to-group3D scene (rect3D [0 0 0] [555 0 555] whi))
(add-to-group3D scene (rect3D [0 555 0] [555 555 555] whi))
(add-to-group3D scene (rect3D [0 0 555] [555 555 555] whi))
;;Add objects
;;(add-to-group3D scene (rotated3D (box3D [0 0 0] [165 330 165] metal) 15 1))
(add-to-group3D scene (translated3D (rotated3D (box3D [0 0 0] [165 330 165] metal) 15 1) [265 0 295]))
(def testsphere (sphere3D [190 190 190] 90 glass))
(add-to-group3D scene testsphere)
(add-to-group3D lights testsphere)
;;Render
(def camera (camera3D [278 278 -800] [278 278 0] 40 10 0))
(render3D "output_raytracer_gisp.png" sw sh spp scene lights camera)
nil