Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# miniRT

![Screenshot 1](./saves/cylinder.bmp?raw=true)
![Cathedral Ruins](./saves/cathedral_ruins.bmp?raw=true)

**A basic RayTracer using minilibX**
project of 42 Paris's common-core
Expand Down
Binary file added saves/cathedral_ruins.bmp
Binary file not shown.
307 changes: 307 additions & 0 deletions scenes/cathedral_ruins.rt
Original file line number Diff line number Diff line change
@@ -0,0 +1,307 @@
R 2560 1440
A 0.08 200,190,170

c 0.0,6.0,12.0 0.03,0,0 70

l -3.0,25.0,-5.0 0.9 255,240,200
l 5.0,20.0,5.0 0.6 255,235,190
l -8.0,15.0,-15.0 0.5 255,220,180
l 0.0,12.0,-25.0 0.4 255,200,150
l 10.0,18.0,-10.0 0.3 200,210,255
l 0.0,3.0,10.0 0.2 180,190,210

pl 0.0,0.0,0.0 0.0,1.0,0.0 170,160,140

sq -2.0,0.01,-20.0 0.0,1.0,0.0 8 140,130,110
sq 3.0,0.01,-8.0 0.0,1.0,0.0 6 155,145,125
sq -5.0,0.01,0.0 0.0,1.0,0.0 5 145,135,120
sq 6.0,0.01,-15.0 0.0,1.0,0.0 7 160,150,130

bx -12.0,6.0,-10.0 1.0,12.0,40.0 190,175,150
bx -12.0,14.0,-25.0 1.0,4.0,10.0 185,170,145
bx -12.0,3.0,8.0 1.0,6.0,8.0 195,180,155

bx 12.0,7.0,-10.0 1.0,14.0,40.0 190,175,150
bx 12.0,16.0,-5.0 1.0,2.0,15.0 185,170,145

bx 0.0,7.0,-30.0 10.0,14.0,1.0 200,185,160
bx -6.0,8.0,-29.5 2.0,16.0,1.0 195,180,155
bx 6.0,8.0,-29.5 2.0,16.0,1.0 195,180,155

bx -9.0,5.0,15.0 3.0,10.0,1.0 190,175,150
bx 9.0,5.0,15.0 3.0,10.0,1.0 190,175,150
bx 0.0,15.0,15.0 12.0,3.0,1.0 185,170,145

bx -12.0,5.0,-15.0 3.0,10.0,1.0 195,180,155
bx 12.0,5.0,-15.0 3.0,10.0,1.0 195,180,155
bx -12.0,5.0,-16.0 1.0,10.0,3.0 190,175,150
bx 12.0,5.0,-16.0 1.0,10.0,3.0 190,175,150

bx -12.5,4.0,0.0 1.5,8.0,2.0 185,170,145
bx 12.5,4.0,0.0 1.5,8.0,2.0 185,170,145
bx -12.5,4.0,-20.0 1.5,8.0,2.0 180,165,140
bx 12.5,4.0,-20.0 1.5,8.0,2.0 180,165,140

cy -6.0,0.0,10.0 0.0,1.0,0.0 1.4 14.0 200,185,160 spec:0.2
dk -6.0,0.01,10.0 0.0,1.0,0.0 2.4 190,175,150
sp -6.0,14.0,10.0 1.6 200,185,160 spec:0.2

cy -6.0,0.0,5.0 0.0,1.0,0.0 1.4 14.0 200,185,160 spec:0.2
dk -6.0,0.01,5.0 0.0,1.0,0.0 2.4 190,175,150
sp -6.0,14.0,5.0 1.6 200,185,160 spec:0.2

cy -6.0,0.0,0.0 0.0,1.0,0.0 1.4 14.0 200,185,160 spec:0.2
dk -6.0,0.01,0.0 0.0,1.0,0.0 2.4 190,175,150
sp -6.0,14.0,0.0 1.6 200,185,160 spec:0.2

cy -6.0,0.0,-5.0 0.0,1.0,0.0 1.4 14.0 200,185,160 spec:0.2
dk -6.0,0.01,-5.0 0.0,1.0,0.0 2.4 190,175,150
sp -6.0,14.0,-5.0 1.6 200,185,160 spec:0.2

cy -6.0,0.0,-10.0 0.0,1.0,0.0 1.4 8.0 200,185,160 spec:0.2
dk -6.0,0.01,-10.0 0.0,1.0,0.0 2.4 190,175,150
sp -6.0,8.0,-10.0 1.6 200,185,160 spec:0.2

cy -6.0,0.0,-15.0 0.0,1.0,0.0 1.4 14.0 200,185,160 spec:0.2
dk -6.0,0.01,-15.0 0.0,1.0,0.0 2.4 190,175,150
sp -6.0,14.0,-15.0 1.6 200,185,160 spec:0.2

cy -6.0,0.0,-20.0 0.0,1.0,0.0 1.4 5.0 200,185,160 spec:0.2
dk -6.0,0.01,-20.0 0.0,1.0,0.0 2.4 190,175,150

cy -6.0,0.0,-25.0 0.0,1.0,0.0 1.4 14.0 200,185,160 spec:0.2
dk -6.0,0.01,-25.0 0.0,1.0,0.0 2.4 190,175,150
sp -6.0,14.0,-25.0 1.6 200,185,160 spec:0.2

cy 6.0,0.0,10.0 0.0,1.0,0.0 1.4 14.0 200,185,160 spec:0.2
dk 6.0,0.01,10.0 0.0,1.0,0.0 2.4 190,175,150
sp 6.0,14.0,10.0 1.6 200,185,160 spec:0.2

cy 6.0,0.0,5.0 0.0,1.0,0.0 1.4 14.0 200,185,160 spec:0.2
dk 6.0,0.01,5.0 0.0,1.0,0.0 2.4 190,175,150
sp 6.0,14.0,5.0 1.6 200,185,160 spec:0.2

cy 6.0,0.0,0.0 0.0,1.0,0.0 1.4 6.0 200,185,160 spec:0.2
dk 6.0,0.01,0.0 0.0,1.0,0.0 2.4 190,175,150

cy 6.0,0.0,-5.0 0.0,1.0,0.0 1.4 14.0 200,185,160 spec:0.2
dk 6.0,0.01,-5.0 0.0,1.0,0.0 2.4 190,175,150
sp 6.0,14.0,-5.0 1.6 200,185,160 spec:0.2

cy 6.0,0.0,-10.0 0.0,1.0,0.0 1.4 14.0 200,185,160 spec:0.2
dk 6.0,0.01,-10.0 0.0,1.0,0.0 2.4 190,175,150
sp 6.0,14.0,-10.0 1.6 200,185,160 spec:0.2

cy 6.0,0.0,-15.0 0.0,1.0,0.0 1.4 10.0 200,185,160 spec:0.2
dk 6.0,0.01,-15.0 0.0,1.0,0.0 2.4 190,175,150
sp 6.0,10.0,-15.0 1.6 200,185,160 spec:0.2

cy 6.0,0.0,-20.0 0.0,1.0,0.0 1.4 14.0 200,185,160 spec:0.2
dk 6.0,0.01,-20.0 0.0,1.0,0.0 2.4 190,175,150
sp 6.0,14.0,-20.0 1.6 200,185,160 spec:0.2

cy 6.0,0.0,-25.0 0.0,1.0,0.0 1.4 14.0 200,185,160 spec:0.2
dk 6.0,0.01,-25.0 0.0,1.0,0.0 2.4 190,175,150
sp 6.0,14.0,-25.0 1.6 200,185,160 spec:0.2

to -6.0,14.0,7.5 0.0,0.0,1.0 2.5 0.4 205,190,165 spec:0.1
to -6.0,14.0,2.5 0.0,0.0,1.0 2.5 0.4 205,190,165 spec:0.1
to -6.0,14.0,-2.5 0.0,0.0,1.0 2.5 0.4 205,190,165 spec:0.1
to -6.0,14.0,-7.5 0.0,0.0,1.0 2.5 0.4 205,190,165 spec:0.1
to -6.0,14.0,-17.5 0.0,0.0,1.0 2.5 0.4 205,190,165 spec:0.1
to -6.0,14.0,-22.5 0.0,0.0,1.0 2.5 0.4 205,190,165 spec:0.1

to 6.0,14.0,7.5 0.0,0.0,1.0 2.5 0.4 205,190,165 spec:0.1
to 6.0,14.0,2.5 0.0,0.0,1.0 2.5 0.4 205,190,165 spec:0.1
to 6.0,14.0,-7.5 0.0,0.0,1.0 2.5 0.4 205,190,165 spec:0.1
to 6.0,14.0,-10.0 0.0,0.0,1.0 2.5 0.4 205,190,165 spec:0.1
to 6.0,14.0,-17.5 0.0,0.0,1.0 2.5 0.4 205,190,165 spec:0.1
to 6.0,14.0,-22.5 0.0,0.0,1.0 2.5 0.4 205,190,165 spec:0.1

to 0.0,15.0,-15.0 1.0,0.0,0.0 6.0 0.5 210,195,170 spec:0.15
to 0.0,15.0,-5.0 1.0,0.0,0.0 6.0 0.5 210,195,170 spec:0.15
to 0.0,15.0,5.0 1.0,0.0,0.0 6.0 0.5 210,195,170 spec:0.15

to 0.0,14.0,-28.0 1.0,0.0,0.0 5.0 0.5 210,195,170 spec:0.15

to -3.0,1.0,-12.0 0.3,0.1,0.7 2.0 0.3 195,180,155
to 5.0,0.5,3.0 0.5,0.2,0.6 1.8 0.3 190,175,150

to 0.0,12.0,-29.2 0.0,0.0,1.0 3.5 0.3 180,170,155 spec:0.3
to 0.0,12.0,-29.2 0.0,0.0,1.0 2.2 0.2 175,165,150 spec:0.3

sp 0.0,15.2,-29.3 0.8 200,50,50 trans:0.7 ior:1.3
sp 1.6,14.6,-29.3 0.8 220,100,30 trans:0.7 ior:1.3
sp 2.8,13.2,-29.3 0.8 230,200,50 trans:0.7 ior:1.3
sp 3.2,12.0,-29.3 0.8 50,200,50 trans:0.7 ior:1.3
sp 2.8,10.8,-29.3 0.8 50,150,200 trans:0.7 ior:1.3
sp 1.6,9.4,-29.3 0.8 80,50,200 trans:0.7 ior:1.3
sp 0.0,8.8,-29.3 0.8 150,50,200 trans:0.7 ior:1.3
sp -1.6,9.4,-29.3 0.8 200,50,150 trans:0.7 ior:1.3
sp -2.8,10.8,-29.3 0.8 50,100,220 trans:0.7 ior:1.3
sp -3.2,12.0,-29.3 0.8 100,200,100 trans:0.7 ior:1.3
sp -2.8,13.2,-29.3 0.8 220,180,50 trans:0.7 ior:1.3
sp -1.6,14.6,-29.3 0.8 200,80,80 trans:0.7 ior:1.3

sp 0.0,13.5,-29.3 0.5 255,220,100 trans:0.8 ior:1.5
sp 1.3,12.7,-29.3 0.5 100,180,255 trans:0.8 ior:1.5
sp 1.3,11.3,-29.3 0.5 255,100,100 trans:0.8 ior:1.5
sp 0.0,10.5,-29.3 0.5 100,255,150 trans:0.8 ior:1.5
sp -1.3,11.3,-29.3 0.5 200,100,255 trans:0.8 ior:1.5
sp -1.3,12.7,-29.3 0.5 255,200,100 trans:0.8 ior:1.5
sp 0.0,12.0,-29.3 0.7 255,255,220 trans:0.85 ior:1.5 spec:0.5

bx 0.0,1.5,-27.0 3.0,1.5,1.5 220,210,190 spec:0.3
bx 0.0,0.5,-27.0 3.5,0.5,2.0 210,200,180

cy -1.0,2.25,-27.0 0.0,1.0,0.0 0.15 1.5 240,230,200 spec:0.4
sp -1.0,3.75,-27.0 0.25 255,220,100 spec:0.8
cy 1.0,2.25,-27.0 0.0,1.0,0.0 0.15 1.5 240,230,200 spec:0.4
sp 1.0,3.75,-27.0 0.25 255,220,100 spec:0.8

cy 0.0,2.25,-27.5 0.0,1.0,0.0 0.2 3.0 150,120,40 spec:0.6 refl:0.2
cy 0.0,4.0,-27.5 1.0,0.0,0.0 0.2 1.5 150,120,40 spec:0.6 refl:0.2

bx 0.0,0.15,-25.5 5.0,0.15,1.0 200,190,170
bx 0.0,0.30,-24.5 6.0,0.15,1.0 200,190,170

cy -4.0,0.5,-11.0 0.2,0.1,0.9 1.3 3.0 195,180,155
cy -3.0,0.6,-9.0 0.8,0.1,0.3 1.3 2.5 200,185,160
cy 5.0,0.5,1.0 0.1,0.05,0.95 1.3 4.0 190,175,150
cy 7.0,0.6,-18.0 0.7,0.15,0.5 1.2 2.0 195,180,155

bx -3.0,0.4,-10.0 0.8,0.8,0.8 185,170,145
bx -5.0,0.3,-11.0 0.6,0.6,0.6 180,165,140
bx -2.0,0.5,-9.5 1.0,1.0,0.7 190,175,150
bx 4.0,0.35,-12.0 0.7,0.7,0.7 185,170,145
bx 3.0,0.25,2.0 0.5,0.5,0.5 180,165,140
bx -8.0,0.4,-5.0 0.9,0.9,0.6 175,160,135
bx 7.0,0.3,-8.0 0.6,0.6,0.8 185,170,145
bx -1.0,0.35,7.0 0.7,0.7,0.5 190,175,150
bx -7.0,0.4,-22.0 0.8,0.6,0.9 180,165,140
bx 8.0,0.5,-3.0 1.0,0.8,0.6 185,170,145
bx -9.0,0.3,5.0 0.5,0.5,0.7 175,160,135
bx 2.0,0.4,-20.0 0.6,0.8,0.5 190,175,150
bx -4.0,0.5,3.0 0.9,0.7,0.8 185,170,145
bx 5.0,0.35,-24.0 0.7,0.5,0.6 180,165,140
bx 9.0,0.3,8.0 0.8,0.6,0.7 175,160,135

sp -2.5,0.2,-10.5 0.4 175,160,135
sp -4.5,0.15,-11.5 0.3 170,155,130
sp 3.5,0.2,-12.5 0.35 180,165,140
sp 5.5,0.25,0.5 0.4 175,160,135
sp -7.5,0.2,-4.5 0.3 170,155,130
sp -1.5,0.15,6.5 0.25 180,165,140
sp 8.5,0.2,-7.5 0.35 175,160,135
sp -8.5,0.15,-21.5 0.3 170,155,130
sp 1.5,0.2,-19.5 0.4 180,165,140
sp 6.5,0.15,2.5 0.3 175,160,135
sp -3.5,0.2,4.5 0.35 170,155,130
sp 4.5,0.15,-23.5 0.25 180,165,140
sp -6.0,0.2,-13.0 0.3 175,160,135
sp 2.0,0.15,-6.0 0.35 170,155,130
sp -1.0,0.2,-17.0 0.4 180,165,140

tr -3.5,0.1,-10.0 -2.5,0.8,-10.5 -3.0,0.1,-11.0 185,170,145
tr 4.0,0.1,-12.0 5.0,0.6,-11.5 4.5,0.1,-12.5 180,165,140
tr -7.0,0.1,-5.0 -6.5,0.5,-4.5 -7.5,0.1,-5.5 175,160,135
tr 7.5,0.1,-8.0 8.0,0.7,-7.5 7.0,0.1,-8.5 185,170,145
tr -1.5,0.1,7.0 -0.5,0.6,6.5 -1.0,0.1,7.5 180,165,140
tr 2.5,0.1,2.5 3.5,0.5,2.0 3.0,0.1,3.0 175,160,135

sp -6.0,0.6,-10.5 0.7 195,180,155
sp 6.0,0.5,0.5 0.6 200,185,160
sp -5.5,0.4,-20.5 0.5 190,175,150
sp 6.5,0.55,-15.5 0.65 195,180,155

tr -6.0,14.0,-8.0 -2.0,10.0,-6.0 -6.0,14.0,-4.0 175,165,145
tr -2.0,10.0,-6.0 2.0,10.0,-6.0 0.0,16.0,-6.0 180,170,150
tr 6.0,14.0,-8.0 2.0,10.0,-6.0 6.0,14.0,-4.0 175,165,145
tr -6.0,15.0,2.0 -3.0,12.0,3.0 -6.0,15.0,4.0 180,170,150
tr 6.0,15.0,2.0 3.0,12.0,3.0 6.0,15.0,4.0 175,165,145
tr -4.0,16.0,-20.0 0.0,18.0,-20.0 4.0,16.0,-20.0 180,170,150

sq -4.0,10.0,-10.0 0.3,0.7,0.1 4 170,160,140
sq 5.0,11.0,-3.0 0.2,0.8,0.3 3.5 175,165,145
sq -3.0,9.0,5.0 0.4,0.6,0.2 3 165,155,135

tr -8.0,0.2,-8.0 -5.0,0.2,-7.0 -7.0,0.2,-10.0 170,160,140
tr 3.0,0.2,4.0 5.0,0.2,3.0 4.0,0.2,6.0 165,155,135
tr -2.0,0.2,-18.0 1.0,0.2,-17.0 -1.0,0.2,-20.0 175,165,145
tr 7.0,0.2,-20.0 9.0,0.2,-19.0 8.0,0.2,-22.0 170,160,140

bx 0.0,17.0,-5.0 0.4,0.4,15.0 190,180,160
bx 0.0,17.0,-22.0 0.4,0.4,6.0 185,175,155

cy -3.0,15.5,-5.0 0.5,0.3,0.0 0.3 7.0 195,185,165
cy 3.0,15.5,-5.0 0.5,0.3,0.0 0.3 7.0 195,185,165
cy -3.0,15.5,-20.0 0.5,0.3,0.0 0.3 7.0 190,180,160

cy -14.0,0.0,14.0 0.0,1.0,0.0 5.0 18.0 195,180,155 spec:0.15
cy -14.0,18.0,14.0 0.0,1.0,0.0 4.5 5.0 190,175,150 spec:0.15
co -14.0,23.0,14.0 0.0,1.0,0.0 5.0 4.0 120,100,80 spec:0.2

bx -11.8,12.0,14.0 0.5,2.0,1.0 60,55,50
bx -14.0,12.0,11.8 1.0,2.0,0.5 60,55,50
bx -11.8,8.0,14.0 0.5,1.5,0.8 65,60,55
bx -14.0,8.0,11.8 0.8,1.5,0.5 65,60,55

bx -12.0,23.0,14.0 0.8,1.0,0.8 200,185,160
bx -14.0,23.0,12.0 0.8,1.0,0.8 200,185,160
bx -16.0,23.0,14.0 0.8,1.0,0.8 195,180,155
bx -14.0,23.0,16.0 0.8,1.0,0.8 195,180,155

cy -10.0,0.4,11.0 0.6,0.1,0.7 2.0 3.0 190,175,150
sp -11.0,0.5,10.0 0.8 185,170,145

sp -2.0,8.0,-4.0 0.15 255,250,230 trans:0.9 ior:1.0
sp -1.0,10.0,-3.0 0.12 255,250,230 trans:0.9 ior:1.0
sp 0.5,9.0,-5.0 0.1 255,250,230 trans:0.9 ior:1.0
sp -0.5,11.0,-6.0 0.13 255,250,230 trans:0.9 ior:1.0
sp 1.0,7.0,-2.0 0.11 255,250,230 trans:0.9 ior:1.0

dk -2.0,0.02,-8.0 0.0,1.0,0.0 3.0 100,110,130 refl:0.6 spec:0.8
dk 3.0,0.02,-3.0 0.0,1.0,0.0 2.5 95,105,125 refl:0.6 spec:0.8
dk -5.0,0.02,4.0 0.0,1.0,0.0 2.0 100,110,130 refl:0.5 spec:0.7
dk 7.0,0.02,-15.0 0.0,1.0,0.0 1.8 95,105,125 refl:0.5 spec:0.7
dk 0.0,0.02,-18.0 0.0,1.0,0.0 3.5 100,115,135 refl:0.7 spec:0.9
dk -8.0,0.02,-12.0 0.0,1.0,0.0 1.5 90,100,120 refl:0.5 spec:0.7
dk 4.0,0.02,8.0 0.0,1.0,0.0 2.2 100,110,130 refl:0.6 spec:0.8
dk -1.0,0.02,-24.0 0.0,1.0,0.0 2.8 95,110,130 refl:0.65 spec:0.85

sq -11.5,10.0,-5.0 1.0,0.0,0.0 2.0 180,40,40 trans:0.75 ior:1.4
sq -11.5,10.0,-15.0 1.0,0.0,0.0 2.0 40,80,180 trans:0.75 ior:1.4
sq 11.5,10.0,-10.0 1.0,0.0,0.0 2.5 40,160,80 trans:0.7 ior:1.4
sq 11.5,10.0,0.0 1.0,0.0,0.0 2.0 180,160,40 trans:0.75 ior:1.4
sq 11.5,10.0,-20.0 1.0,0.0,0.0 2.0 160,40,160 trans:0.7 ior:1.4

el -3.0,0.1,-6.0 0.5,0.05,0.3 200,50,50 trans:0.6 ior:1.3
el 2.0,0.1,-14.0 0.4,0.05,0.4 50,50,200 trans:0.6 ior:1.3
el -6.0,0.1,-19.0 0.3,0.05,0.5 50,180,50 trans:0.6 ior:1.3
el 4.0,0.1,5.0 0.5,0.05,0.3 200,180,50 trans:0.6 ior:1.3
el -1.0,0.1,-2.0 0.4,0.05,0.4 180,50,180 trans:0.6 ior:1.3

sq 0.0,11.0,-29.5 0.0,0.0,1.0 3.0 240,220,180 trans:0.5 ior:1.4 spec:0.3

sp -11.5,12.5,-5.0 0.5 220,60,60 trans:0.6 ior:1.3
sp -11.5,12.5,-15.0 0.5 60,100,220 trans:0.6 ior:1.3
sp 11.5,12.5,-10.0 0.5 60,200,100 trans:0.6 ior:1.3
sp 11.5,12.5,0.0 0.5 220,200,60 trans:0.6 ior:1.3

pa -3.0,0.0,10.0 0.0,1.0,0.0 0.6 1.5 200,190,170 spec:0.3
dk -3.0,1.5,10.0 0.0,1.0,0.0 1.8 180,190,210 refl:0.3 spec:0.5

bx 3.0,0.2,-22.0 2.5,0.2,1.2 170,165,155 spec:0.15
sp 3.0,0.45,-22.0 0.3 160,155,145

cy -2.0,0.0,-20.0 0.0,1.0,0.0 0.2 4.0 80,60,50 spec:0.7 refl:0.3
dk -2.0,4.0,-20.0 0.0,1.0,0.0 1.2 80,60,50 spec:0.7 refl:0.3
sp -2.0,4.2,-20.0 0.15 255,200,80 spec:0.9
sp -1.5,4.2,-20.0 0.15 255,200,80 spec:0.9
sp -2.5,4.2,-20.0 0.15 255,200,80 spec:0.9

el -11.3,3.0,5.0 0.8,1.5,0.5 40,80,30
el -11.3,5.0,4.0 0.6,1.2,0.4 35,75,25
el -11.3,2.0,6.0 0.7,1.0,0.6 45,85,35
el 11.3,4.0,-7.0 0.5,1.3,0.5 40,80,30
el 11.3,6.0,-8.0 0.6,1.0,0.4 35,70,25
Loading