first commit

This commit is contained in:
Jose Caban
2025-06-07 01:59:34 -04:00
commit 388ac241f0
3558 changed files with 9116289 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
Microsoft Visual Studio Solution File, Format Version 8.00
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "proj1", "proj1.vcproj", "{C957954C-FC60-409E-A34D-16C23164ACF5}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfiguration) = preSolution
Debug = Debug
Release = Release
EndGlobalSection
GlobalSection(ProjectConfiguration) = postSolution
{C957954C-FC60-409E-A34D-16C23164ACF5}.Debug.ActiveCfg = Debug|Win32
{C957954C-FC60-409E-A34D-16C23164ACF5}.Debug.Build.0 = Debug|Win32
{C957954C-FC60-409E-A34D-16C23164ACF5}.Release.ActiveCfg = Release|Win32
{C957954C-FC60-409E-A34D-16C23164ACF5}.Release.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
EndGlobalSection
GlobalSection(ExtensibilityAddIns) = postSolution
EndGlobalSection
EndGlobal

View File

@@ -0,0 +1,21 @@
Microsoft Visual Studio Solution File, Format Version 8.00
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "proj1", "proj1.vcproj", "{C957954C-FC60-409E-A34D-16C23164ACF5}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfiguration) = preSolution
Debug = Debug
Release = Release
EndGlobalSection
GlobalSection(ProjectConfiguration) = postSolution
{C957954C-FC60-409E-A34D-16C23164ACF5}.Debug.ActiveCfg = Debug|Win32
{C957954C-FC60-409E-A34D-16C23164ACF5}.Debug.Build.0 = Debug|Win32
{C957954C-FC60-409E-A34D-16C23164ACF5}.Release.ActiveCfg = Release|Win32
{C957954C-FC60-409E-A34D-16C23164ACF5}.Release.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
EndGlobalSection
GlobalSection(ExtensibilityAddIns) = postSolution
EndGlobalSection
EndGlobal

View File

@@ -0,0 +1,83 @@
<H3> Example inputs for Project 1<br>
If your code stays within the running time indicated below on the machines
downstairs, you will get full efficiency credit.<br>
Also, note that the pictures posted below are jpeg-compressed. The artifacts
of compression are easily visible. They shouldn't be visible on the ppm files
though - they will look much cleaner and sharper. </H3>
<a href=input1.txt>input1</a> (showing effect of different specular exponents): 11sec<br>
<img src="output1.jpg"><br><br><hr size=10><br>
<a href=input2.txt>input2</a> (this is a bunch of spheres forming a doughnut): 34sec<br>
<img src="output2.jpg"><br><br><hr size=10><br>
<a href=input3.txt>input3</a>: 31sec<br>
<img src="output3.jpg"><br><br><hr size=10><br>
<a href=input4.txt>input4</a>: 13sec<br>
<img src="output4.jpg"><br><br><hr size=10><br>
<a href=input5.txt>input5</a> (400 random spheres): 150sec<br>
<img src="output5.jpg"><br><br><hr size=10><br>
<a href=input6.txt>input6</a>: 11sec<br>
<img src="output6.jpg"><br><br><hr size=10><br>
<a href=input7.txt>input7</a>: 30sec<br>
<img src="output7.jpg"><br><br><hr size=10><br>
<a href=input8.txt>input8</a>: 27sec<br>
<img src="output8.jpg"><br><br><hr size=10><br>
<a href=input9.txt>input9</a>: 18sec<br>
<img src="output9.jpg"><br><br><hr size=10><br>
<a href=input10.txt>input10</a>: 22sec<br>
<img src="output10.jpg"><br><br><hr size=10><br>
<a href=input11.txt>input11</a>: 12sec<br>
<img src="output11.jpg"><br><br><hr size=10><br>
<a href=input12.txt>input12</a>: 18sec<br>
<img src="output12.jpg"><br><br><hr size=10><br>
<a href=input13.txt>input13</a>: 13sec<br>
<img src="output13.jpg"><br><br><hr size=10><br>
<a href=input14.txt>input14</a>: 19sec<br>
<img src="output14.jpg"><br><br><hr size=10><br>
<a href=input15.txt>input15</a>: 20sec<br>
<img src="output15.jpg"><br><br><hr size=10><br>
<a href=input16.txt>input16</a>: 27sec<br>
<img src="output16.jpg"><br><br><hr size=10><br>
<a href=input17.txt>input17</a>: 21sec<br>
<img src="output17.jpg"><br><br><hr size=10><br>
<a href=input18.txt>input18</a>: 33sec<br>
<img src="output18.jpg"><br><br><hr size=10><br>
<a href=input19.txt>input19</a>: 17sec<br>
<img src="output19.jpg"><br><br><hr size=10><br>

View File

@@ -0,0 +1,20 @@
512 512
0 0 -40
-1 -1 -30
2 0 0
0 2 0
100 100 -100 1
1
4
S
2 2 3 2
.4 0 0 .2 0 0 .4 50
S
-2 -2 3 2
.4 0 0 .2 0 0 .4 2
S
2 -2 3 2
.4 0 0 .2 0 0 .4 10
S
-2 2 3 2
.4 0 0 .2 0 0 .4 100

View File

@@ -0,0 +1,48 @@
512 512
0 0 20
-1 -1 1
2 0 0
0 2 0
1.5 0.5 10 0.8
0.2
12
T
0.99 -1 -1
-0.99 -1 -1
-0.99 1 -1
1 1 1 1 1 1 0 1
T
0.99 -1 -1
-0.99 1 -1
0.99 1 -1
1 1 1 1 1 1 0 1
S
-0.227881 0.0368164 0.58335 0.128076
1 1 0 1 1 0 0 1
S
0.500195 -0.513525 -0.130127 0.14541
0 1 1 0 1 1 0 1
S
0.343408 0.443066 0.571289 0.272363
1 0 1 1 0 1 0 1
S
0.340234 -0.309131 0.072998 0.316309
1 1 1 1 1 1 0 1
S
0.292627 -0.588428 -0.127588 0.325098
1 0 0 1 0 0 0 1
S
-0.603662 0.293896 -0.0558594 0.139795
0 1 0 0 1 0 0 1
S
0.484326 0.1479 0.594141 0.281885
0 0 1 0 0 1 0 1
S
-0.112988 0.519873 0.524316 0.262842
1 1 0 1 1 0 0 1
S
-0.00888672 -0.24502 0.576367 0.240869
1 0 1 1 0 1 0 1
S
0.564307 0.253906 -0.3104 0.115137
0 0 1 0 0 1 0 1

View File

@@ -0,0 +1,11 @@
512 512
0 0 20
-1 -1 1
2 0 0
0 2 0
10 10 10 0.8
0.2
1
S
0 0 0 0.5
1 1 0 1 1 0 0 1

View File

@@ -0,0 +1,23 @@
512 512
0 0 20
-1 -1 1
2 0 0
0 2 0
10 3 2 0.8
0.2
5
S
0.5 0.5 0 0.45
1 0 0 1 0 0 0 1
S
0.5 -0.5 0 0.45
0 1 0 0 1 0 0 1
S
-0.5 0.5 0 0.45
0 0 1 0 0 1 0 1
S
-0.5 -0.5 0 0.45
1 1 1 1 1 1 0 1
S
0 0 0 0.4
1 1 0 1 1 0 0 1

View File

@@ -0,0 +1,11 @@
512 512
0 0 20
-1 -1 1
2 0 0
0 2 0
10 10 10 0.8
0.2
1
S
0 0 0 1
1 1 0 1 1 0 0 1

View File

@@ -0,0 +1,38 @@
512 512
0 0 20
-1 -1 1
2 0 0
0 2 0
1.5 0.5 1.1 0.8
0.2
10
S
-0.262939 0.0424805 0.673096 0.104211
0.0791016 0.249023 0.0722656 0.0791016 0.249023 0.0722656 0 1
S
0.577148 -0.592529 -0.150146 0.106812
0.916992 0.486328 0.745117 0.916992 0.486328 0.745117 0 1
S
0.39624 0.51123 0.65918 0.125854
0.0820312 0.992188 0.776367 0.0820312 0.992188 0.776367 0 1
S
0.392578 -0.356689 0.0842285 0.132446
0.337891 0.294922 0.59668 0.337891 0.294922 0.59668 0 1
S
0.337646 -0.678955 -0.147217 0.133765
0.849609 0.298828 0.0126953 0.849609 0.298828 0.0126953 0 1
S
-0.696533 0.339111 -0.0644531 0.105969
0.337891 0.286133 0.34082 0.337891 0.286133 0.34082 0 1
S
0.558838 0.170654 0.685547 0.127283
0.0917969 0.207031 0.416992 0.0917969 0.207031 0.416992 0 1
S
-0.130371 0.599854 0.60498 0.124426
0.675781 0.0820312 0.516602 0.675781 0.0820312 0.516602 0 1
S
-0.0102539 -0.282715 0.665039 0.12113
0.282227 0.30957 0.464844 0.282227 0.30957 0.464844 0 1
S
0.651123 0.292969 -0.358154 0.102271
0.157227 0.563477 0.219727 0.157227 0.563477 0.219727 0 1

View File

@@ -0,0 +1,68 @@
512 512
0 0 20
-1 -1 1
2 0 0
0 2 0
1.5 0.5 1.1 0.8
0.2
20
S
-0.262939 0.0424805 0.673096 0.104211
0.0791016 0.249023 0.0722656 0.0791016 0.249023 0.0722656 0 1
S
0.577148 -0.592529 -0.150146 0.106812
0.916992 0.486328 0.745117 0.916992 0.486328 0.745117 0 1
S
0.39624 0.51123 0.65918 0.125854
0.0820312 0.992188 0.776367 0.0820312 0.992188 0.776367 0 1
S
0.392578 -0.356689 0.0842285 0.132446
0.337891 0.294922 0.59668 0.337891 0.294922 0.59668 0 1
S
0.337646 -0.678955 -0.147217 0.133765
0.849609 0.298828 0.0126953 0.849609 0.298828 0.0126953 0 1
S
-0.696533 0.339111 -0.0644531 0.105969
0.337891 0.286133 0.34082 0.337891 0.286133 0.34082 0 1
S
0.558838 0.170654 0.685547 0.127283
0.0917969 0.207031 0.416992 0.0917969 0.207031 0.416992 0 1
S
-0.130371 0.599854 0.60498 0.124426
0.675781 0.0820312 0.516602 0.675781 0.0820312 0.516602 0 1
S
-0.0102539 -0.282715 0.665039 0.12113
0.282227 0.30957 0.464844 0.282227 0.30957 0.464844 0 1
S
0.651123 0.292969 -0.358154 0.102271
0.157227 0.563477 0.219727 0.157227 0.563477 0.219727 0 1
S
-0.37207 0.112061 0.32959 0.128162
0.623047 0.647461 0.478516 0.623047 0.647461 0.478516 0 1
S
0.213867 0.109131 -0.672363 0.133362
0.0546875 0.0898438 0.541016 0.0546875 0.0898438 0.541016 0 1
S
0.202148 -0.128906 -0.0432129 0.127942
0.548828 0.170898 0.308594 0.548828 0.170898 0.308594 0 1
S
-0.624023 0.389648 0.169922 0.136145
0.0898438 0.251953 0.0253906 0.0898438 0.251953 0.0253906 0 1
S
0.563965 0.138428 0.566162 0.127905
0.666016 0.806641 0.495117 0.666016 0.806641 0.495117 0 1
S
-0.217529 -0.340576 -0.730957 0.100183
0.308594 0.871094 0.894531 0.308594 0.871094 0.894531 0 1
S
-0.273193 -0.720703 -0.32666 0.103552
0.133789 0.493164 0.839844 0.133789 0.493164 0.839844 0 1
S
-0.511963 -0.498047 -0.112061 0.119299
0.145508 0.922852 0.479492 0.145508 0.922852 0.479492 0 1
S
-0.176514 0.618896 -0.378662 0.118127
0.991211 0.75 0.227539 0.991211 0.75 0.227539 0 1
S
0.25708 0.33252 0.207275 0.135522
0.0107422 0.698242 0.953125 0.0107422 0.698242 0.953125 0 1

View File

@@ -0,0 +1,158 @@
512 512
0 0 20
-1 -1 1
2 0 0
0 2 0
1.5 0.5 1.1 0.8
0.2
50
S
-0.262939 0.0424805 0.673096 0.104211
0.0791016 0.249023 0.0722656 0.0791016 0.249023 0.0722656 0 1
S
0.577148 -0.592529 -0.150146 0.106812
0.916992 0.486328 0.745117 0.916992 0.486328 0.745117 0 1
S
0.39624 0.51123 0.65918 0.125854
0.0820312 0.992188 0.776367 0.0820312 0.992188 0.776367 0 1
S
0.392578 -0.356689 0.0842285 0.132446
0.337891 0.294922 0.59668 0.337891 0.294922 0.59668 0 1
S
0.337646 -0.678955 -0.147217 0.133765
0.849609 0.298828 0.0126953 0.849609 0.298828 0.0126953 0 1
S
-0.696533 0.339111 -0.0644531 0.105969
0.337891 0.286133 0.34082 0.337891 0.286133 0.34082 0 1
S
0.558838 0.170654 0.685547 0.127283
0.0917969 0.207031 0.416992 0.0917969 0.207031 0.416992 0 1
S
-0.130371 0.599854 0.60498 0.124426
0.675781 0.0820312 0.516602 0.675781 0.0820312 0.516602 0 1
S
-0.0102539 -0.282715 0.665039 0.12113
0.282227 0.30957 0.464844 0.282227 0.30957 0.464844 0 1
S
0.651123 0.292969 -0.358154 0.102271
0.157227 0.563477 0.219727 0.157227 0.563477 0.219727 0 1
S
-0.37207 0.112061 0.32959 0.128162
0.623047 0.647461 0.478516 0.623047 0.647461 0.478516 0 1
S
0.213867 0.109131 -0.672363 0.133362
0.0546875 0.0898438 0.541016 0.0546875 0.0898438 0.541016 0 1
S
0.202148 -0.128906 -0.0432129 0.127942
0.548828 0.170898 0.308594 0.548828 0.170898 0.308594 0 1
S
-0.624023 0.389648 0.169922 0.136145
0.0898438 0.251953 0.0253906 0.0898438 0.251953 0.0253906 0 1
S
0.563965 0.138428 0.566162 0.127905
0.666016 0.806641 0.495117 0.666016 0.806641 0.495117 0 1
S
-0.217529 -0.340576 -0.730957 0.100183
0.308594 0.871094 0.894531 0.308594 0.871094 0.894531 0 1
S
-0.273193 -0.720703 -0.32666 0.103552
0.133789 0.493164 0.839844 0.133789 0.493164 0.839844 0 1
S
-0.511963 -0.498047 -0.112061 0.119299
0.145508 0.922852 0.479492 0.145508 0.922852 0.479492 0 1
S
-0.176514 0.618896 -0.378662 0.118127
0.991211 0.75 0.227539 0.991211 0.75 0.227539 0 1
S
0.25708 0.33252 0.207275 0.135522
0.0107422 0.698242 0.953125 0.0107422 0.698242 0.953125 0 1
S
0.509766 0.322998 -0.635742 0.125671
0.530273 0.28418 0.779297 0.530273 0.28418 0.779297 0 1
S
-0.498047 -0.583008 -0.465088 0.113037
0.442383 0.769531 0.862305 0.442383 0.769531 0.862305 0 1
S
-0.440918 0.230713 0.493652 0.130872
0.868164 0.84668 0.307617 0.868164 0.84668 0.307617 0 1
S
-0.644531 -0.448242 -0.401367 0.119373
0.154297 0.258789 0.464844 0.154297 0.258789 0.464844 0 1
S
0.625488 0.0322266 0.436523 0.118237
0.526367 0.265625 0.170898 0.526367 0.265625 0.170898 0 1
S
0.706787 -0.412354 -0.712646 0.127063
0.328125 0.570312 0.0693359 0.328125 0.570312 0.0693359 0 1
S
0.172119 0.495117 -0.699463 0.11344
0.0332031 0.274414 0.181641 0.0332031 0.274414 0.181641 0 1
S
-0.676025 0.658447 -0.366943 0.128528
0.719727 0.0253906 0.277344 0.719727 0.0253906 0.277344 0 1
S
-0.655518 -0.213135 0.193359 0.101501
0.242188 0.160156 0.526367 0.242188 0.160156 0.526367 0 1
S
-0.576416 -0.320068 0.227051 0.130981
0.976562 0.648438 0.548828 0.976562 0.648438 0.548828 0 1
S
0.521484 0.585938 0.286377 0.10282
0.55957 0.550781 0.433594 0.55957 0.550781 0.433594 0 1
S
-0.44458 0.130371 0.287842 0.11853
0.948242 0.105469 0.254883 0.948242 0.105469 0.254883 0 1
S
0.249023 -0.0981445 -0.39917 0.120325
0.416016 0.275391 0.583008 0.416016 0.275391 0.583008 0 1
S
0.256348 -0.32666 -0.0820312 0.116003
0.862305 0.807617 0.253906 0.862305 0.807617 0.253906 0 1
S
-0.629883 0.407959 -0.602051 0.10542
0.674805 0.420898 0.220703 0.674805 0.420898 0.220703 0 1
S
-0.175781 0.0205078 0.259277 0.131018
0.798828 0.270508 0.321289 0.798828 0.270508 0.321289 0 1
S
0.189697 -0.282715 -0.432129 0.115564
0.507812 0.109375 0.957031 0.507812 0.109375 0.957031 0 1
S
0.0571289 -0.288574 0.344971 0.121826
0.820312 0.650391 0.00976562 0.820312 0.650391 0.00976562 0 1
S
-0.512695 -0.343506 0.552246 0.119629
0.914062 0.0664062 0.667969 0.914062 0.0664062 0.667969 0 1
S
0.30835 0.384521 0.0834961 0.130908
0.459961 0.543945 0.651367 0.459961 0.543945 0.651367 0 1
S
-0.194092 0.13916 0.0197754 0.10022
0.191406 0.549805 0.420898 0.191406 0.549805 0.420898 0 1
S
0.224854 -0.494385 -0.28418 0.123401
0.0439453 0.918945 0.207031 0.0439453 0.918945 0.207031 0 1
S
-0.648926 -0.427002 -0.162598 0.120581
0.0273438 0.480469 0.0722656 0.0273438 0.480469 0.0722656 0 1
S
0.0439453 -0.410156 0.194824 0.119922
0.0341797 0.629883 0.355469 0.0341797 0.629883 0.355469 0 1
S
-0.371338 -0.130371 0.744873 0.128271
0.988281 0.980469 0.760742 0.988281 0.980469 0.760742 0 1
S
0.614502 -0.398438 0.61377 0.133032
0.19043 0.560547 0.504883 0.19043 0.560547 0.504883 0 1
S
0.573486 -0.360352 -0.533936 0.103772
0.0498047 0.928711 0.649414 0.0498047 0.928711 0.649414 0 1
S
0.691406 0.443115 0.20874 0.100732
0.956055 0.461914 0.550781 0.956055 0.461914 0.550781 0 1
S
-0.743408 -0.0688477 -0.679688 0.118237
0.265625 0.914062 0.240234 0.265625 0.914062 0.240234 0 1
S
0.558838 0.0791016 -0.000732422 0.116333
0.425781 0.183594 0.316406 0.425781 0.183594 0.316406 0 1

View File

@@ -0,0 +1,68 @@
512 512
0 0 20
-1 -1 1
2 0 0
0 2 0
1.5 0.5 1.1 0.8
0.2
20
S
-0.227881 0.0368164 0.58335 0.128076
0.0791016 0.249023 0.0722656 0.0791016 0.249023 0.0722656 0 1
S
0.500195 -0.513525 -0.130127 0.14541
0.916992 0.486328 0.745117 0.916992 0.486328 0.745117 0 1
S
0.343408 0.443066 0.571289 0.272363
0.0820312 0.992188 0.776367 0.0820312 0.992188 0.776367 0 1
S
0.340234 -0.309131 0.072998 0.316309
0.337891 0.294922 0.59668 0.337891 0.294922 0.59668 0 1
S
0.292627 -0.588428 -0.127588 0.325098
0.849609 0.298828 0.0126953 0.849609 0.298828 0.0126953 0 1
S
-0.603662 0.293896 -0.0558594 0.139795
0.337891 0.286133 0.34082 0.337891 0.286133 0.34082 0 1
S
0.484326 0.1479 0.594141 0.281885
0.0917969 0.207031 0.416992 0.0917969 0.207031 0.416992 0 1
S
-0.112988 0.519873 0.524316 0.262842
0.675781 0.0820312 0.516602 0.675781 0.0820312 0.516602 0 1
S
-0.00888672 -0.24502 0.576367 0.240869
0.282227 0.30957 0.464844 0.282227 0.30957 0.464844 0 1
S
0.564307 0.253906 -0.3104 0.115137
0.157227 0.563477 0.219727 0.157227 0.563477 0.219727 0 1
S
-0.322461 0.0971191 0.285645 0.287744
0.623047 0.647461 0.478516 0.623047 0.647461 0.478516 0 1
S
0.185352 0.0945801 -0.582715 0.322412
0.0546875 0.0898438 0.541016 0.0546875 0.0898438 0.541016 0 1
S
0.175195 -0.111719 -0.0374512 0.286279
0.548828 0.170898 0.308594 0.548828 0.170898 0.308594 0 1
S
-0.54082 0.337695 0.147266 0.340967
0.0898438 0.251953 0.0253906 0.0898438 0.251953 0.0253906 0 1
S
0.48877 0.119971 0.490674 0.286035
0.666016 0.806641 0.495117 0.666016 0.806641 0.495117 0 1
S
-0.188525 -0.295166 -0.633496 0.101221
0.308594 0.871094 0.894531 0.308594 0.871094 0.894531 0 1
S
-0.236768 -0.624609 -0.283105 0.123682
0.133789 0.493164 0.839844 0.133789 0.493164 0.839844 0 1
S
-0.443701 -0.431641 -0.0971191 0.228662
0.145508 0.922852 0.479492 0.145508 0.922852 0.479492 0 1
S
-0.152979 0.536377 -0.328174 0.22085
0.991211 0.75 0.227539 0.991211 0.75 0.227539 0 1
S
0.222803 0.288184 0.179639 0.336816
0.0107422 0.698242 0.953125 0.0107422 0.698242 0.953125 0 1

View File

@@ -0,0 +1,158 @@
512 512
0 0 20
-1 -1 1
2 0 0
0 2 0
1.5 0.5 1.1 0.8
0.2
50
S
-0.227881 0.0368164 0.58335 0.128076
0.0791016 0.249023 0.0722656 0.0791016 0.249023 0.0722656 0 1
S
0.500195 -0.513525 -0.130127 0.14541
0.916992 0.486328 0.745117 0.916992 0.486328 0.745117 0 1
S
0.343408 0.443066 0.571289 0.272363
0.0820312 0.992188 0.776367 0.0820312 0.992188 0.776367 0 1
S
0.340234 -0.309131 0.072998 0.316309
0.337891 0.294922 0.59668 0.337891 0.294922 0.59668 0 1
S
0.292627 -0.588428 -0.127588 0.325098
0.849609 0.298828 0.0126953 0.849609 0.298828 0.0126953 0 1
S
-0.603662 0.293896 -0.0558594 0.139795
0.337891 0.286133 0.34082 0.337891 0.286133 0.34082 0 1
S
0.484326 0.1479 0.594141 0.281885
0.0917969 0.207031 0.416992 0.0917969 0.207031 0.416992 0 1
S
-0.112988 0.519873 0.524316 0.262842
0.675781 0.0820312 0.516602 0.675781 0.0820312 0.516602 0 1
S
-0.00888672 -0.24502 0.576367 0.240869
0.282227 0.30957 0.464844 0.282227 0.30957 0.464844 0 1
S
0.564307 0.253906 -0.3104 0.115137
0.157227 0.563477 0.219727 0.157227 0.563477 0.219727 0 1
S
-0.322461 0.0971191 0.285645 0.287744
0.623047 0.647461 0.478516 0.623047 0.647461 0.478516 0 1
S
0.185352 0.0945801 -0.582715 0.322412
0.0546875 0.0898438 0.541016 0.0546875 0.0898438 0.541016 0 1
S
0.175195 -0.111719 -0.0374512 0.286279
0.548828 0.170898 0.308594 0.548828 0.170898 0.308594 0 1
S
-0.54082 0.337695 0.147266 0.340967
0.0898438 0.251953 0.0253906 0.0898438 0.251953 0.0253906 0 1
S
0.48877 0.119971 0.490674 0.286035
0.666016 0.806641 0.495117 0.666016 0.806641 0.495117 0 1
S
-0.188525 -0.295166 -0.633496 0.101221
0.308594 0.871094 0.894531 0.308594 0.871094 0.894531 0 1
S
-0.236768 -0.624609 -0.283105 0.123682
0.133789 0.493164 0.839844 0.133789 0.493164 0.839844 0 1
S
-0.443701 -0.431641 -0.0971191 0.228662
0.145508 0.922852 0.479492 0.145508 0.922852 0.479492 0 1
S
-0.152979 0.536377 -0.328174 0.22085
0.991211 0.75 0.227539 0.991211 0.75 0.227539 0 1
S
0.222803 0.288184 0.179639 0.336816
0.0107422 0.698242 0.953125 0.0107422 0.698242 0.953125 0 1
S
0.441797 0.279932 -0.550977 0.271143
0.530273 0.28418 0.779297 0.530273 0.28418 0.779297 0 1
S
-0.431641 -0.505273 -0.403076 0.186914
0.442383 0.769531 0.862305 0.442383 0.769531 0.862305 0 1
S
-0.382129 0.199951 0.427832 0.305811
0.868164 0.84668 0.307617 0.868164 0.84668 0.307617 0 1
S
-0.558594 -0.388477 -0.347852 0.22915
0.154297 0.258789 0.464844 0.154297 0.258789 0.464844 0 1
S
0.54209 0.0279297 0.37832 0.221582
0.526367 0.265625 0.170898 0.526367 0.265625 0.170898 0 1
S
0.612549 -0.357373 -0.617627 0.28042
0.328125 0.570312 0.0693359 0.328125 0.570312 0.0693359 0 1
S
0.14917 0.429102 -0.606201 0.1896
0.0332031 0.274414 0.181641 0.0332031 0.274414 0.181641 0 1
S
-0.585889 0.570654 -0.318018 0.290186
0.719727 0.0253906 0.277344 0.719727 0.0253906 0.277344 0 1
S
-0.568115 -0.184717 0.167578 0.11001
0.242188 0.160156 0.526367 0.242188 0.160156 0.526367 0 1
S
-0.499561 -0.277393 0.196777 0.306543
0.976562 0.648438 0.548828 0.976562 0.648438 0.548828 0 1
S
0.451953 0.507812 0.248193 0.118799
0.55957 0.550781 0.433594 0.55957 0.550781 0.433594 0 1
S
-0.385303 0.112988 0.249463 0.223535
0.948242 0.105469 0.254883 0.948242 0.105469 0.254883 0 1
S
0.21582 -0.0850586 -0.345947 0.235498
0.416016 0.275391 0.583008 0.416016 0.275391 0.583008 0 1
S
0.222168 -0.283105 -0.0710937 0.206689
0.862305 0.807617 0.253906 0.862305 0.807617 0.253906 0 1
S
-0.545898 0.353564 -0.521777 0.136133
0.674805 0.420898 0.220703 0.674805 0.420898 0.220703 0 1
S
-0.152344 0.0177734 0.224707 0.306787
0.798828 0.270508 0.321289 0.798828 0.270508 0.321289 0 1
S
0.164404 -0.24502 -0.374512 0.20376
0.507812 0.109375 0.957031 0.507812 0.109375 0.957031 0 1
S
0.0495117 -0.250098 0.298975 0.245508
0.820312 0.650391 0.00976562 0.820312 0.650391 0.00976562 0 1
S
-0.444336 -0.297705 0.478613 0.230859
0.914062 0.0664062 0.667969 0.914062 0.0664062 0.667969 0 1
S
0.267236 0.333252 0.0723633 0.306055
0.459961 0.543945 0.651367 0.459961 0.543945 0.651367 0 1
S
-0.168213 0.120605 0.0171387 0.101465
0.191406 0.549805 0.420898 0.191406 0.549805 0.420898 0 1
S
0.194873 -0.428467 -0.246289 0.256006
0.0439453 0.918945 0.207031 0.0439453 0.918945 0.207031 0 1
S
-0.562402 -0.370068 -0.140918 0.237207
0.0273438 0.480469 0.0722656 0.0273438 0.480469 0.0722656 0 1
S
0.0380859 -0.355469 0.168848 0.232813
0.0341797 0.629883 0.355469 0.0341797 0.629883 0.355469 0 1
S
-0.321826 -0.112988 0.645557 0.288477
0.988281 0.980469 0.760742 0.988281 0.980469 0.760742 0 1
S
0.532568 -0.345313 0.531934 0.320215
0.19043 0.560547 0.504883 0.19043 0.560547 0.504883 0 1
S
0.497021 -0.312305 -0.462744 0.125146
0.0498047 0.928711 0.649414 0.0498047 0.928711 0.649414 0 1
S
0.599219 0.384033 0.180908 0.104883
0.956055 0.461914 0.550781 0.956055 0.461914 0.550781 0 1
S
-0.644287 -0.059668 -0.589063 0.221582
0.265625 0.914062 0.240234 0.265625 0.914062 0.240234 0 1
S
0.484326 0.0685547 -0.000634766 0.208887
0.425781 0.183594 0.316406 0.425781 0.183594 0.316406 0 1

View File

@@ -0,0 +1,38 @@
512 512
0 0 20
-1 -1 1
2 0 0
0 2 0
1.5 0.5 1.1 0.8
0.2
10
S
-0.227881 0.0368164 0.58335 0.128076
0.0791016 0.249023 0.0722656 0.0791016 0.249023 0.0722656 0 1
S
0.500195 -0.513525 -0.130127 0.14541
0.916992 0.486328 0.745117 0.916992 0.486328 0.745117 0 1
S
0.343408 0.443066 0.571289 0.272363
0.0820312 0.992188 0.776367 0.0820312 0.992188 0.776367 0 1
S
0.340234 -0.309131 0.072998 0.316309
0.337891 0.294922 0.59668 0.337891 0.294922 0.59668 0 1
S
0.292627 -0.588428 -0.127588 0.325098
0.849609 0.298828 0.0126953 0.849609 0.298828 0.0126953 0 1
S
-0.603662 0.293896 -0.0558594 0.139795
0.337891 0.286133 0.34082 0.337891 0.286133 0.34082 0 1
S
0.484326 0.1479 0.594141 0.281885
0.0917969 0.207031 0.416992 0.0917969 0.207031 0.416992 0 1
S
-0.112988 0.519873 0.524316 0.262842
0.675781 0.0820312 0.516602 0.675781 0.0820312 0.516602 0 1
S
-0.00888672 -0.24502 0.576367 0.240869
0.282227 0.30957 0.464844 0.282227 0.30957 0.464844 0 1
S
0.564307 0.253906 -0.3104 0.115137
0.157227 0.563477 0.219727 0.157227 0.563477 0.219727 0 1

View File

@@ -0,0 +1,38 @@
3840 2160
0 0 20
-1 -1 1
2 0 0
0 2 0
1.5 0.5 1.1 0.8
0.2
10
S
-0.227881 0.0368164 0.58335 0.128076
0.0791016 0.249023 0.0722656 0.0791016 0.249023 0.0722656 0 1
S
0.500195 -0.513525 -0.130127 0.14541
0.916992 0.486328 0.745117 0.916992 0.486328 0.745117 0 1
S
0.343408 0.443066 0.571289 0.272363
0.0820312 0.992188 0.776367 0.0820312 0.992188 0.776367 0 1
S
0.340234 -0.309131 0.072998 0.316309
0.337891 0.294922 0.59668 0.337891 0.294922 0.59668 0 1
S
0.292627 -0.588428 -0.127588 0.325098
0.849609 0.298828 0.0126953 0.849609 0.298828 0.0126953 0 1
S
-0.603662 0.293896 -0.0558594 0.139795
0.337891 0.286133 0.34082 0.337891 0.286133 0.34082 0 1
S
0.484326 0.1479 0.594141 0.281885
0.0917969 0.207031 0.416992 0.0917969 0.207031 0.416992 0 1
S
-0.112988 0.519873 0.524316 0.262842
0.675781 0.0820312 0.516602 0.675781 0.0820312 0.516602 0 1
S
-0.00888672 -0.24502 0.576367 0.240869
0.282227 0.30957 0.464844 0.282227 0.30957 0.464844 0 1
S
0.564307 0.253906 -0.3104 0.115137
0.157227 0.563477 0.219727 0.157227 0.563477 0.219727 0 1

View File

@@ -0,0 +1,191 @@
512 512
0 0 -40
-1 -1 -30
2 0 0
0 2 0
100 100 -100 1
1
61
S
2 0 3 1.5
.4 0 0 .2 0 0 .4 10
S
1.9894 0.205636 3 1.5
.4 0 0 .2 0 0 .4 10
S
1.95771 0.409092 3 1.5
.4 0 0 .2 0 0 .4 10
S
1.90528 0.608212 3 1.5
.4 0 0 .2 0 0 .4 10
S
1.83264 0.800886 3 1.5
.4 0 0 .2 0 0 .4 10
S
1.74059 0.98507 3 1.5
.4 0 0 .2 0 0 .4 10
S
1.63008 1.15881 3 1.5
.4 0 0 .2 0 0 .4 10
S
1.50229 1.32027 3 1.5
.4 0 0 .2 0 0 .4 10
S
1.35858 1.46774 3 1.5
.4 0 0 .2 0 0 .4 10
S
1.20047 1.59965 3 1.5
.4 0 0 .2 0 0 .4 10
S
1.02964 1.7146 3 1.5
.4 0 0 .2 0 0 .4 10
S
0.847889 1.81138 3 1.5
.4 0 0 .2 0 0 .4 10
S
0.657154 1.88895 3 1.5
.4 0 0 .2 0 0 .4 10
S
0.459452 1.94651 3 1.5
.4 0 0 .2 0 0 .4 10
S
0.256881 1.98343 3 1.5
.4 0 0 .2 0 0 .4 10
S
0.0515869 1.99933 3 1.5
.4 0 0 .2 0 0 .4 10
S
-0.154254 1.99404 3 1.5
.4 0 0 .2 0 0 .4 10
S
-0.35846 1.96761 3 1.5
.4 0 0 .2 0 0 .4 10
S
-0.558866 1.92033 3 1.5
.4 0 0 .2 0 0 .4 10
S
-0.753349 1.85269 3 1.5
.4 0 0 .2 0 0 .4 10
S
-0.939846 1.76541 3 1.5
.4 0 0 .2 0 0 .4 10
S
-1.11638 1.65943 3 1.5
.4 0 0 .2 0 0 .4 10
S
-1.28108 1.53585 3 1.5
.4 0 0 .2 0 0 .4 10
S
-1.43221 1.39599 3 1.5
.4 0 0 .2 0 0 .4 10
S
-1.56815 1.24133 3 1.5
.4 0 0 .2 0 0 .4 10
S
-1.68747 1.07352 3 1.5
.4 0 0 .2 0 0 .4 10
S
-1.7889 0.894329 3 1.5
.4 0 0 .2 0 0 .4 10
S
-1.87138 0.705658 3 1.5
.4 0 0 .2 0 0 .4 10
S
-1.93401 0.509507 3 1.5
.4 0 0 .2 0 0 .4 10
S
-1.97615 0.307955 3 1.5
.4 0 0 .2 0 0 .4 10
S
-1.99734 0.10314 3 1.5
.4 0 0 .2 0 0 .4 10
S
-1.99736 -0.102769 3 1.5
.4 0 0 .2 0 0 .4 10
S
-1.97621 -0.307589 3 1.5
.4 0 0 .2 0 0 .4 10
S
-1.93411 -0.509148 3 1.5
.4 0 0 .2 0 0 .4 10
S
-1.87151 -0.705311 3 1.5
.4 0 0 .2 0 0 .4 10
S
-1.78907 -0.893997 3 1.5
.4 0 0 .2 0 0 .4 10
S
-1.68767 -1.07321 3 1.5
.4 0 0 .2 0 0 .4 10
S
-1.56838 -1.24104 3 1.5
.4 0 0 .2 0 0 .4 10
S
-1.43247 -1.39572 3 1.5
.4 0 0 .2 0 0 .4 10
S
-1.28137 -1.53561 3 1.5
.4 0 0 .2 0 0 .4 10
S
-1.11669 -1.65922 3 1.5
.4 0 0 .2 0 0 .4 10
S
-0.940173 -1.76524 3 1.5
.4 0 0 .2 0 0 .4 10
S
-0.753692 -1.85255 3 1.5
.4 0 0 .2 0 0 .4 10
S
-0.559222 -1.92023 3 1.5
.4 0 0 .2 0 0 .4 10
S
-0.358825 -1.96755 3 1.5
.4 0 0 .2 0 0 .4 10
S
-0.154624 -1.99401 3 1.5
.4 0 0 .2 0 0 .4 10
S
0.0512164 -1.99934 3 1.5
.4 0 0 .2 0 0 .4 10
S
0.256514 -1.98348 3 1.5
.4 0 0 .2 0 0 .4 10
S
0.459092 -1.9466 3 1.5
.4 0 0 .2 0 0 .4 10
S
0.656804 -1.88908 3 1.5
.4 0 0 .2 0 0 .4 10
S
0.847554 -1.81153 3 1.5
.4 0 0 .2 0 0 .4 10
S
1.02932 -1.71479 3 1.5
.4 0 0 .2 0 0 .4 10
S
1.20018 -1.59987 3 1.5
.4 0 0 .2 0 0 .4 10
S
1.35831 -1.46799 3 1.5
.4 0 0 .2 0 0 .4 10
S
1.50205 -1.32055 3 1.5
.4 0 0 .2 0 0 .4 10
S
1.62986 -1.15911 3 1.5
.4 0 0 .2 0 0 .4 10
S
1.7404 -0.985392 3 1.5
.4 0 0 .2 0 0 .4 10
S
1.8325 -0.801225 3 1.5
.4 0 0 .2 0 0 .4 10
S
1.90516 -0.608565 3 1.5
.4 0 0 .2 0 0 .4 10
S
1.95764 -0.409455 3 1.5
.4 0 0 .2 0 0 .4 10
S
1.98936 -0.206005 3 1.5
.4 0 0 .2 0 0 .4 10

View File

@@ -0,0 +1,191 @@
512 512
0 0 -40
-1 -1 -30
2 0 0
0 2 0
100 100 -100 .72
.72
61
S
0 2 0 1.5
0 0 0 0.1 0.1 0.1 .1 10
S
0.157573 1.9894 0.318931 1.5
0.00273889 0.0109256 0.0244703 0.1 0.1 0.1 .3 50
S
0.313476 1.95771 0.63448 1.5
0.0109256 0.0432248 0.0954861 0.1 0.1 0.1 .3 50
S
0.466056 1.90528 0.943305 1.5
0.0244703 0.0954861 0.206096 0.1 0.1 0.1 .3 50
S
0.613696 1.83264 1.24213 1.5
0.0432248 0.165426 0.345474 0.1 0.1 0.1 .3 50
S
0.754831 1.74059 1.52779 1.5
0.0669834 0.249987 0.499977 0.1 0.1 0.1 .3 50
S
0.887965 1.63008 1.79726 1.5
0.0954861 0.345474 0.654482 0.1 0.1 0.1 .3 50
S
1.01169 1.50229 2.04767 1.5
0.12842 0.447714 0.793866 0.1 0.1 0.1 .3 50
S
1.12469 1.35858 2.27638 1.5
0.165426 0.55224 0.904487 0.1 0.1 0.1 .3 50
S
1.22576 1.20047 2.48097 1.5
0.206096 0.654482 0.975515 0.1 0.1 0.1 .3 50
S
1.31385 1.02964 2.65925 1.5
0.249987 0.749973 1 0.1 0.1 0.1 .3 50
S
1.38801 0.847889 2.80935 1.5
0.296616 0.83454 0.975544 0.1 0.1 0.1 .3 50
S
1.44745 0.657154 2.92967 1.5
0.345474 0.904487 0.904541 0.1 0.1 0.1 .3 50
S
1.49156 0.459452 3.01894 1.5
0.396025 0.956756 0.793941 0.1 0.1 0.1 .3 50
S
1.51985 0.256881 3.0762 1.5
0.447714 0.989065 0.65457 0.1 0.1 0.1 .3 50
S
1.53203 0.0515869 3.10086 1.5
0.499977 1 0.500069 0.1 0.1 0.1 .3 50
S
1.52798 -0.154254 3.09265 1.5
0.55224 0.989084 0.345562 0.1 0.1 0.1 .3 50
S
1.50773 -0.35846 3.05167 1.5
0.60393 0.956794 0.206171 0.1 0.1 0.1 .3 50
S
1.4715 -0.558866 2.97833 1.5
0.654482 0.904541 0.0955405 0.1 0.1 0.1 .3 50
S
1.41967 -0.753349 2.87343 1.5
0.703342 0.834609 0.0244989 0.1 0.1 0.1 .3 50
S
1.35279 -0.939846 2.73807 1.5
0.749973 0.750053 8.58469e-09 0.1 0.1 0.1 .3 50
S
1.27157 -1.11638 2.57368 1.5
0.793866 0.65457 0.0244417 0.1 0.1 0.1 .3 50
S
1.17688 -1.28108 2.38202 1.5
0.83454 0.552332 0.0954316 0.1 0.1 0.1 .3 50
S
1.06971 -1.43221 2.1651 1.5
0.871549 0.447806 0.206021 0.1 0.1 0.1 .3 50
S
0.951199 -1.56815 1.92524 1.5
0.904487 0.345562 0.345386 0.1 0.1 0.1 .3 50
S
0.822609 -1.68747 1.66497 1.5
0.932993 0.250067 0.499884 0.1 0.1 0.1 .3 50
S
0.685299 -1.7889 1.38706 1.5
0.956756 0.165494 0.654394 0.1 0.1 0.1 .3 50
S
0.540726 -1.87138 1.09444 1.5
0.975515 0.0955405 0.793791 0.1 0.1 0.1 .3 50
S
0.390421 -1.93401 0.790218 1.5
0.989065 0.0432625 0.904432 0.1 0.1 0.1 .3 50
S
0.235977 -1.97615 0.477622 1.5
0.997256 0.0109448 0.975487 0.1 0.1 0.1 .3 50
S
0.0790329 -1.99734 0.159964 1.5
1 8.58469e-09 1 0.1 0.1 0.1 .3 50
S
-0.0787493 -1.99736 -0.15939 1.5
0.997266 0.0109063 0.975573 0.1 0.1 0.1 .3 50
S
-0.235697 -1.97621 -0.477054 1.5
0.989084 0.0431871 0.904596 0.1 0.1 0.1 .3 50
S
-0.390146 -1.93411 -0.789662 1.5
0.975544 0.0954316 0.794016 0.1 0.1 0.1 .3 50
S
-0.54046 -1.87151 -1.0939 1.5
0.956794 0.165357 0.654658 0.1 0.1 0.1 .3 50
S
-0.685045 -1.78907 -1.38654 1.5
0.93304 0.249906 0.500162 0.1 0.1 0.1 .3 50
S
-0.822369 -1.68767 -1.66449 1.5
0.904541 0.345386 0.34565 0.1 0.1 0.1 .3 50
S
-0.950976 -1.56838 -1.92479 1.5
0.871611 0.447622 0.206246 0.1 0.1 0.1 .3 50
S
-1.0695 -1.43247 -2.16469 1.5
0.834609 0.552148 0.095595 0.1 0.1 0.1 .3 50
S
-1.17669 -1.28137 -2.38165 1.5
0.793941 0.654394 0.0245276 0.1 0.1 0.1 .3 50
S
-1.27141 -1.11669 -2.57336 1.5
0.750053 0.749893 3.43388e-08 0.1 0.1 0.1 .3 50
S
-1.35265 -0.940173 -2.73779 1.5
0.703426 0.834471 0.0244131 0.1 0.1 0.1 .3 50
S
-1.41956 -0.753692 -2.87321 1.5
0.65457 0.904432 0.0953772 0.1 0.1 0.1 .3 50
S
-1.47142 -0.559222 -2.97817 1.5
0.604021 0.956719 0.205946 0.1 0.1 0.1 .3 50
S
-1.50768 -0.358825 -3.05156 1.5
0.552332 0.989046 0.345298 0.1 0.1 0.1 .3 50
S
-1.52796 -0.154624 -3.09261 1.5
0.500069 1 0.499792 0.1 0.1 0.1 .3 50
S
-1.53204 0.0512164 -3.10088 1.5
0.447806 0.989103 0.654306 0.1 0.1 0.1 .3 50
S
-1.51989 0.256514 -3.07628 1.5
0.396115 0.956832 0.793716 0.1 0.1 0.1 .3 50
S
-1.49162 0.459092 -3.01907 1.5
0.345562 0.904596 0.904378 0.1 0.1 0.1 .3 50
S
-1.44755 0.656804 -2.92986 1.5
0.296701 0.834678 0.975458 0.1 0.1 0.1 .3 50
S
-1.38813 0.847554 -2.80959 1.5
0.250067 0.750134 1 0.1 0.1 0.1 .3 50
S
-1.31399 1.02932 -2.65955 1.5
0.206171 0.654658 0.975601 0.1 0.1 0.1 .3 50
S
-1.22593 1.20018 -2.48131 1.5
0.165494 0.552424 0.90465 0.1 0.1 0.1 .3 50
S
-1.12488 1.35831 -2.27677 1.5
0.128482 0.447899 0.794091 0.1 0.1 0.1 .3 50
S
-1.0119 1.50205 -2.0481 1.5
0.0955405 0.34565 0.654746 0.1 0.1 0.1 .3 50
S
-0.888197 1.62986 -1.79773 1.5
0.0670298 0.250147 0.500255 0.1 0.1 0.1 .3 50
S
-0.755078 1.7404 -1.52829 1.5
0.0432625 0.165563 0.345738 0.1 0.1 0.1 .3 50
S
-0.613956 1.8325 -1.24266 1.5
0.0244989 0.095595 0.206321 0.1 0.1 0.1 .3 50
S
-0.466327 1.90516 -0.943853 1.5
0.0109448 0.0433002 0.0956495 0.1 0.1 0.1 .3 50
S
-0.313754 1.95764 -0.635043 1.5
0.00274858 0.0109641 0.0245563 0.1 0.1 0.1 .3 50
S
-0.157856 1.98936 -0.319502 1.5
8.58469e-09 3.43388e-08 7.72622e-08 0.1 0.1 0.1 .3 50

View File

@@ -0,0 +1,16 @@
512 512
0 0 -40
-1 -1 -30
2 0 0
0 2 0
100 100 -100 1
1
2
T
3 3 -1
0 3 -1
4 0 -1
.5 .5 .5 .2 .2 .2 .3 20
S
0 0 5 4
0 0 .5 0 0 .2 .3 20

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,14 @@
512 512
0 0 -40
-1 -1 -30
2 0 0
0 2 0
100 100 -100 1
1
2
S
2.5 .5 -3 1
.5 .5 .5 .2 .2 .2 .3 4
S
0 0 3 4
0 0 .5 0 0 .2 .3 200

View File

@@ -0,0 +1,132 @@
512 512
0 0 -40
-1 -1 -30
2 0 0
0 2 0
-5 -5 -10 .36
.36
40
T
5 5 15
-4.9 5 15
5 -4.9 15
.2 .2 .2 .2 .2 .2 .6 40
T
-5 -5 15
-5 4.9 15
4.9 -5 15
.2 .2 .2 .2 .2 .2 .6 40
S
-1.75293 0.283203 9.4873 1.0877
0.0791016 0.249023 0.0722656 0.379102 0.549023 0.372266 0.2 154.906
S
-3.9502 -1.00098 9.0918 -0.716992
0.513672 0.745117 0.52832 0.813672 1.04512 0.82832 0.2 137.328
S
4.39453 1.55273 9.58984 -0.792188
0.223633 0.523438 0.475586 0.523633 0.823438 0.775586 0.2 23.4609
S
-4.32617 -1.68945 8.52539 0.60332
0.450195 0.905273 0.196289 0.750195 1.20527 0.496289 0.2 181.078
S
0.751953 -1.49414 9.93652 -0.728711
0.452148 0.0859375 0.84082 0.752148 0.385937 1.14082 0.2 133.422
S
3.56934 3.2959 8.72559 0.427539
0.914062 0.272461 0.0917969 1.21406 0.572461 0.391797 0.2 159.594
S
-2.08496 -0.869141 8.99902 1.00664
0.651367 0.675781 0.0820312 0.951367 0.975781 0.382031 0.2 104.32
S
-0.0683594 -1.88477 9.43359 -0.363477
0.282227 0.30957 0.464844 0.582227 0.60957 0.764844 0.2 174.633
S
1.95312 -2.3877 9.69727 0.0427734
0.436523 0.780273 0.496094 0.736523 1.08027 0.796094 0.2 30.8828
S
2.19727 -3.75488 1.88477 0.552539
0.521484 0.285156 0.145508 0.821484 0.585156 0.445508 0.2 180.297
S
-4.44824 -0.273438 9.55078 -0.341016
0.269531 0.171875 0.0576172 0.569531 0.471875 0.357617 0.2 150.023
S
2.25586 -0.854492 3.45703 -0.632031
0.519531 0.226562 0.963867 0.819531 0.526563 1.26387 0.2 18.9688
S
1.66016 -0.654297 2.33887 0.658008
0.583984 0.724609 0.416992 0.883984 1.02461 0.716992 0.2 69.3594
S
-2.17773 -0.546875 7.86621 0.337695
0.807617 0.746094 0.839844 1.10762 1.04609 1.13984 0.2 109.789
S
-4.01367 4.27734 6.62598 0.779102
0.220703 0.234375 0.0273438 0.520703 0.534375 0.327344 0.2 70.1406
S
0.864258 -3.99414 3.64746 0.878711
0.25293 0.376953 0.576172 0.55293 0.676953 0.876172 0.2 84.0078
S
2.46094 -0.546875 0.214844 0.276172
0.384766 0.459961 0.582031 0.684766 0.759961 0.882031 0.2 36.9375
S
-3.25195 4.95117 1.58203 -0.258008
0.736328 0.523438 0.914062 1.03633 0.823438 1.21406 0.2 187.719
S
-3.33984 2.05566 7.56348 0.311328
0.824219 0.459961 0.543945 1.12422 0.759961 0.843945 0.2 70.7266
S
-1.29395 0.927734 5.13184 1.19414
0.808594 0.450195 0.420898 1.10859 0.750195 0.720898 0.2 60.9609
S
-3.2959 -1.89453 1.87988 0.156055
0.918945 0.207031 0.865234 1.21895 0.507031 1.16523 0.2 114.867
S
-1.08398 -2.74414 4.86328 -0.280469
0.0722656 0.0585938 0.546875 0.372266 0.358594 0.846875 0.2 52.9531
S
-2.65625 4.8291 1.85059 -0.155469
0.495117 0.173828 0.993164 0.795117 0.473828 1.29316 0.2 50.2188
S
-4.94141 0.0976562 6.19629 1.01934
0.53125 0.818359 0.119141 0.83125 1.11836 0.419141 0.2 39.0859
S
-2.80273 2.47559 8.82324 -0.280469
0.711914 0.899414 0.0498047 1.01191 1.19941 0.349805 0.2 15.2578
S
-3.24707 4.60938 7.9541 0.47832
0.0195312 0.956055 0.461914 0.319531 1.25605 0.761914 0.2 90.8438
S
-4.95605 -0.458984 0.46875 -0.286328
0.734375 0.914062 0.759766 1.03438 1.21406 1.05977 0.2 150.023
S
0.527344 -0.00488281 7.82227 0.774219
0.183594 0.316406 0.617188 0.483594 0.616406 0.917188 0.2 52.1719
S
-4.10645 -4.2627 8.87695 -0.33418
0.953125 0.275391 0.537109 1.25313 0.575391 0.837109 0.2 121.508
S
-1.76758 0.634766 8.37891 0.826953
0.170898 0.786133 0.0751953 0.470898 1.08613 0.375195 0.2 36.9375
S
0.605469 0.844727 8.4668 0.0554688
0.254883 0.452148 0.399414 0.554883 0.752148 0.699414 0.2 129.125
S
-2.74414 -4.1748 9.66797 0.467578
0.151367 0.683594 0.477539 0.451367 0.983594 0.777539 0.2 6.27344
S
-2.68066 -3.51074 7.46094 -0.289258
0.0224609 0.0292969 0.0917969 0.322461 0.329297 0.391797 0.2 134.789
S
-4.21875 -2.08008 6.47461 0.526172
0.203125 0.629883 0.494141 0.503125 0.929883 0.794141 0.2 184.594
S
2.69531 -4.00879 3.86719 -0.00703125
0.650391 0.373047 0.152344 0.950391 0.673047 0.452344 0.2 180.688
S
2.69043 0.429688 6.84082 -0.414258
0.401367 0.890625 0.412109 0.701367 1.19063 0.712109 0.2 174.047
S
-4.05762 -0.478516 1.875 0.409961
0.933594 0.283203 0.121094 1.23359 0.583203 0.421094 0.2 183.227
S
4.33105 -4.13086 7.0752 -0.136914
0.456055 0.920898 0.418945 0.756055 1.2209 0.718945 0.2 184.594

View File

@@ -0,0 +1,51 @@
512 512
0 0 20
-1 -1 1
2 0 0
0 2 0
3 10 10 0.8
0.2
9
T
1 1 1
0.12321 0.12321 -1
-1 1 1
1 1 1 1 1 1 0 1
T
-1 1 1
-0.12321 0.12321 -1
0.12321 0.12321 -1
1 1 1 1 1 1 0 1
T
1 -1 1
0.12321 -0.12321 -1
-1 -1 1
1 1 1 1 1 1 0 1
T
-1 -1 1
-0.12321 -0.12321 -1
0.12321 -0.12321 -1
1 1 1 1 1 1 0 1
T
1 1 1
0.12321 0.12321 -1
1 -1 1
1 0 0 1 0 0 0 1
T
1 -1 1
0.12321 -0.12321 -1
0.12321 0.12321 -1
1 0 0 1 0 0 0 1
T
-1 1 1
-0.12321 0.12321 -1
-1 -1 1
1 1 0 1 1 0 0 1
T
-1 -1 1
-0.12321 -0.12321 -1
-0.12321 0.12321 -1
1 1 0 1 1 0 0 1
S
0 0 0 0.5
1 0 1 1 0 1 0 1

View File

@@ -0,0 +1,21 @@
512 512
0 0 20
-1 -1 1
2 0 0
0 2 0
3 2 5 0.8
0.2
3
T
0 0.2 1
1 1 0.5
-1 1 0.5
0 0 1 0 0 1 0 1
T
0 -0.2 1
1 -1 0.5
-1 -1 0.5
0 0 1 0 0 1 0 1
S
0 0 0 0.7
0 1 0 0 1 0 0 1

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

40
CS4451/proj1/Makefile Normal file
View File

@@ -0,0 +1,40 @@
CC = g++
OPT = -Wno-deprecated -O3
LIBS = -lm
SRC = proj1.cpp functions.cpp image.cpp ray.cpp raytracer.cpp
OBJ = proj1.o functions.o image.o ray.o raytracer.o
INC = defs.h functions.h
TARGET = proj1
MISC = Makefile
all: $(TARGET)
$(TARGET) : $(OBJ) $(MISC)
$(CC) $(OPT) -o $(TARGET) $(OBJ) $(LIBS)
%.o : %.cpp $(MISC) $(INC)
$(CC) $(OPT) -c -o $@ $<
clean:
rm -f $(OBJ) $(TARGET)
#all : proj1
#proj1 : proj1.o functions.o image.o ray.o
# $(CC) $(OPT) -o proj1 proj1.o functions.o $(LIBS)
#proj1.o : proj1.c defs.h
# $(CC) $(OPT) -c proj1.c
#functions.o: functions.cpp defs.h functions.h
# $(CC) $(OPT) -c functions.cpp
#image.o: image.cpp defs.h
# $(CC) $(OPT) -c image.cpp
#clean:
# rm *.o proj1

262147
CS4451/proj1/Output/output1.ppm Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

262147
CS4451/proj1/Output/output2.ppm Normal file

File diff suppressed because it is too large Load Diff

262147
CS4451/proj1/Output/output3.ppm Normal file

File diff suppressed because it is too large Load Diff

262147
CS4451/proj1/Output/output4.ppm Normal file

File diff suppressed because it is too large Load Diff

262147
CS4451/proj1/Output/output5.ppm Normal file

File diff suppressed because it is too large Load Diff

262147
CS4451/proj1/Output/output6.ppm Normal file

File diff suppressed because it is too large Load Diff

262147
CS4451/proj1/Output/output7.ppm Normal file

File diff suppressed because it is too large Load Diff

262147
CS4451/proj1/Output/output8.ppm Normal file

File diff suppressed because it is too large Load Diff

262147
CS4451/proj1/Output/output9.ppm Normal file

File diff suppressed because it is too large Load Diff

Binary file not shown.

144
CS4451/proj1/defs.h Normal file
View File

@@ -0,0 +1,144 @@
#ifndef _DEFS_H_
#define _DEFS_H_
//#define bDebug
#include <ostream>
#include "functions.h"
using namespace std;
typedef struct {
double r,g,b;
} RGB;
typedef struct Vector{
public:
double x = NAN, y = NAN, z = NAN;
struct Vector operator+(Vector &other);
struct Vector operator-(Vector &other);
struct Vector operator*(Vector &other);
struct Vector operator/(Vector &other);
struct Vector operator*(int &other);
struct Vector operator*(double &other);
} Vector;
typedef Vector Point;
typedef struct {
Point center;
double intensity;
} Light;
typedef struct MaterialAttributes{
double k_dr, k_dg, k_db; //diffuse properties, rgb
double k_ar, k_ag, k_ab; //ambient properties, rgb
double k_s; //specular properties, rgb same
double n_spec; //specular exponent
} MaterialAttributes;
std::ostream &operator<< ( std::ostream &ofs, struct MaterialAttributes m );
class Ray {
public:
Point origin = Point();
Vector direction = Vector();
Ray() {}
Ray (Point start, Point end);
double length = NAN;
Ray operator+(Ray &other);
Ray operator-(Ray &other);
};
class Primitive {
public:
MaterialAttributes attrib;
virtual double intersectsWith(Ray)=0;
virtual bool intersectsWithSelf(Point p, Light l, Point v)=0;
virtual Vector normal(Point p, Light l)=0;
virtual void printName() { printf("I am a primitive. Wheeee"); }
};
class Sphere : public Primitive {
public:
Point center;
double radius;
double intersectsWith(Ray ray);
bool intersectsWithSelf(Point p, Light l, Point v);
void printName();
Vector normal(Point p);
Vector normal(Point p, Light l);
friend std::ostream &operator<< ( std::ostream &ofs, Sphere s );
};
class Triangle : public Primitive {
public:
Point a1, a2, a3;
double intersectsWith(Ray ray);
bool intersectsWithSelf(Point p, Light l, Point v);
void printName();
Vector normal(Point p, Light l);
Vector normal(Point p);
friend std::ostream &operator<< ( std::ostream &ofs, Triangle t );
};
/* ------------ image class ------------ */
class image {
int xsize,ysize; // resolution
RGB *rgb; // pixel intensities
public:
image ( int m, int n ); // allocates image of specified size
RGB &pixel ( int i, int j ); // access to a specific pixel
friend std::ostream &operator<< ( std::ostream &ofs, image i );
// dumps image as a ppm file
};
/* ------------- RayTracer ------------ */
class RayTracer {
public:
int m, n; // specify the output image size, assuming m x n
Point e, l; // viewpoint e, lower left corner l
Vector h, v; // vectors vertical and horizontal edges
Light light; // Light source
double ambience; // Ambient light intensity
int numPrimitives; // Number of Primitives
std::vector<Primitive*> primitives;
void getPixelAt(int x, int y, RGB& pixel);
private:
//double length(Point a, Point b);
};
/*void printObject(Point p);*/
void printObject(Vector v);
void printObject(int i);
void printObject(double f);
void printObject(Light l);
void printObject(MaterialAttributes attrib);
void scanInput(Point &point, char* input);
void scanInput(MaterialAttributes &attrib, char* input);
void scanInput(vector<Primitive*> &primitives, int numPrimitives, char* input);
void scanInput(Vector &v, char* input);
void scanInput(Light &light, char* input);
double length(Point p, Point p2);
double length(Vector p);
double dot(Vector,Vector);
#endif

442
CS4451/proj1/functions.cpp Normal file
View File

@@ -0,0 +1,442 @@
#include <math.h>
#include <iostream>
#include <stdlib.h>
#include <vector>
#include "defs.h"
#include "functions.h"
using namespace std;
void printObject(Vector v) {
cerr << v.x << " " << v.y << " " << v.z << endl;
}
void printObject(int i) {
cerr << i << endl;
}
void printObject(double f) {
cerr << f << endl;
}
void printObject(Light l) {
cerr << l.center.x << " " << l.center.y << " " << l.center.z << " I: " << l.intensity << endl;
}
void printObject(MaterialAttributes attrib) {
cerr << " k_dr, k_dg, k_db " << attrib.k_dr << " " << attrib.k_dg << " " << attrib.k_db << " "
<< attrib.k_ar << " " << attrib.k_ag << " " << attrib.k_ab << " "
<< attrib.k_s << " " << attrib.n_spec << endl;
}
void scanInput(MaterialAttributes &attrib, char* input) {
char *pEnd;
cin.getline(input,81);
attrib.k_dr = strtod(input,&pEnd);
attrib.k_dg = strtod(pEnd,&pEnd);
attrib.k_db = strtod(pEnd,&pEnd);
attrib.k_ar = strtod(pEnd,&pEnd);
attrib.k_ag = strtod(pEnd,&pEnd);
attrib.k_ab = strtod(pEnd,&pEnd);
attrib.k_s = strtod(pEnd,&pEnd);
attrib.n_spec = strtod(pEnd,NULL);
}
void scanInput(vector<Primitive*> &primitives, int numPrimitives, char* input) {
int i;
char *pEnd;
for (i = 0; i < numPrimitives; i++) {
cin.getline(input,81);
switch (input[0]) {
case 'S': {
Sphere* sphere = new Sphere();
cin.getline(input,81);
sphere->center.x = strtod(input, &pEnd);
sphere->center.y = strtod(pEnd, &pEnd);
sphere->center.z = strtod(pEnd, &pEnd);
sphere->radius = strtod(pEnd,NULL);
scanInput(sphere->attrib, input);
primitives.push_back(sphere);
//printObject(sphere->attrib);
#ifdef bDebug
cout << "Got Sphere.." << endl;
printObject(sphere->center);
printObject(sphere->radius);
printObject(sphere->attrib);
#endif
break;
}
case 'T': {
Triangle* triangle = new Triangle();
scanInput(triangle->a1,input);
scanInput(triangle->a2,input);
scanInput(triangle->a3,input);
scanInput(triangle->attrib, input);
primitives.push_back(triangle);
#ifdef bDebug
cout << "Got Triangle.." << endl;
printObject(triangle->a1);
printObject(triangle->a2);
printObject(triangle->a3);
printObject(triangle->attrib);
#endif
break;
}
default:
cout << "Error bad\n";
break;
};
}
}
void scanInput(Vector &v, char* input) {
char* pEnd;
cin.getline(input, 81);
v.x = strtod(input,&pEnd);
v.y = strtod(pEnd,&pEnd);
v.z = strtod(pEnd,NULL);
}
void scanInput(Light &light, char* input) {
char* pEnd;
cin.getline(input,81);
light.center.x = strtod(input, &pEnd);
light.center.y = strtod(pEnd, &pEnd);
light.center.z = strtod(pEnd, &pEnd);
light.intensity = strtod(pEnd, NULL);
}
/* Useful operator overloads */
/* ------------- <Vector> -------------*/
Vector Vector::operator+(Vector &other) {
Vector v;
v.x = x + other.x;
v.y = y + other.y;
v.z = z + other.z;
return v;
}
Vector Vector::operator-(Vector &other) {
Vector v;
v.x = x - other.x;
v.y = y - other.y;
v.z = z - other.z;
return v;
}
Vector Vector::operator*(Vector &other) {
Vector v;
v.x = x * other.x;
v.y = y * other.y;
v.z = z * other.z;
return v;
}
Vector Vector::operator/(Vector &other) {
Vector v;
v.x = x / other.x;
v.y = y / other.y;
v.z = z / other.z;
return v;
}
Vector Vector::operator*(int &other) {
Vector v;
v.x = x * other;
v.y = y * other;
v.z = z * other;
return v;
}
Vector Vector::operator*(double &other) {
Vector v;
v.x = x * other;
v.y = y * other;
v.z = z * other;
return v;
}
/* ------------ </Vector> ----------- */
/* ------------ <ostream> ----------- */
ostream &operator<< ( ostream &ofs, struct MaterialAttributes m ) {
ofs << " Material Attributes: " << endl;
ofs << " k_dr: " << m.k_dr << " k_dg: " << m.k_dg << " k_db: " << m.k_db << endl;
ofs << " k_ar: " << m.k_ar << " k_ag: " << m.k_ag << " k_ab: " << m.k_ab << endl;
ofs << " k_s: " << m.k_s << " n_spec: " << m.n_spec << endl;
return ofs;
}
ostream &operator<< ( ostream &ofs, Sphere s ) {
ofs << "Sphere: " << endl;
ofs << " Center: " << "(" << s.center.x << ","
<< s.center.y << "," << s.center.z << endl;
return ofs;
}
ostream &operator<< ( ostream &ofs, Triangle t ) {
ofs << "Triangle: " << endl;
return ofs;
}
/* ------------ </ostream> ------------- */
/* ----------- Primitive stuff ----------- */
double length(Vector p) {
double toRet;
toRet = pow(p.x,2)+pow(p.y,2)+pow(p.z,2);
toRet = sqrt(toRet);
return toRet;
}
double dot(Vector v1, Vector v2) {
double toRet;
toRet = (v1.x*v2.x) + (v1.y*v2.y) + (v1.z*v2.z);
return toRet;
}
inline double discriminant(double A, double B, double C) {
return ((B*B) - (4*A*C));
}
void Sphere::printName() {
cout << "This is of type Sphere" << endl;
}
bool Sphere::intersectsWithSelf(Point p, Light l, Point v) {
Vector cp, pl;
cp = p - this->center;
pl = l.center - p;
if (dot(cp,pl) < 0) {
return true;
} else return false;
}
double Sphere::intersectsWith(Ray ray) {
double C = pow(length(ray.origin - this->center),2) - pow(this->radius,2);
double B;
double A;
double discrim;
A = pow(length(ray.direction),2);
B = 2*dot(ray.direction,ray.origin - this->center);
discrim = discriminant(A,B,C);
if (discrim < 0) {
return -1;
} else if (discrim > 0) {
double a, b;
a = ((-1*B)+sqrt(discrim))/(2*A);
b = ((-1*B)-sqrt(discrim))/(2*A);
if (b>=0) return b;
else return a;
} else { //discrim==0
return ((-1*B) / (2*A));
}
}
void Triangle::printName() {
cout << "This is of type Triangle" << endl;
}
inline Vector cross(Vector a, Vector b) {
Vector toRet;
toRet.x = ( (a.y*b.z) - (a.z*b.y) ); //i
toRet.y = ( (a.z*b.x) - (a.x*b.z) ); //j
toRet.z = ( (a.x*b.y) - (a.y*b.x) ); //k
return toRet;
}
inline char bestCoord(Vector v1) {
//Lazy fast method
if (abs((int)v1.x) > abs((int)v1.y)) {
if (abs((int)v1.x) > abs((int)v1.z)) {
return 'x';
} else {
return 'z';
}
} else {
if (abs((int)v1.y) > abs((int)v1.z)) {
return 'y';
} else {
return 'z';
}
}
}
Vector Sphere::normal(Point p, Light l) {
Vector normal;
normal = p-this->center;
return normal;
}
Vector Triangle::normal(Point p, Light l) {
Vector normal, a1a2, a1a3, pl;
a1a2 = this->a2 - this->a1;
a1a3 = this->a3 - this->a1;
normal = cross(a1a2,a1a3);
pl = l.center - p;
if (dot(normal,pl) < 0) {
//normal = normal * ((double)-1.0);
//STUPID OPERATOR OVERLOADING DOESNT WORK
normal.x = normal.x * -1;
normal.y = normal.y * -1;
normal.z = normal.z * -1;
}
return normal;
}
Vector Triangle::normal(Point p) {
Vector normal, a1a2, a1a3, pl;
a1a2 = this->a2 - this->a1;
a1a3 = this->a3 - this->a1;
normal = cross(a1a2,a1a3);
return normal;
}
bool Triangle::intersectsWithSelf(Point p, Light l, Point v) {
Vector normal = this->normal(p,l), pv;
pv = v - p;
if (dot(normal,pv) < 0) {
return true;
} else return false;
}
double Triangle::intersectsWith(Ray ray) {
Vector normal = this->normal(this->a1);
//calculate t
double top = dot(ray.origin - a1,normal);
double bottom = dot(ray.direction, normal);
double t = -1.0 * (top/bottom);
if (t < 0) {
return -1;
} else {
Point p = (ray.direction * t) + ray.origin;
Vector pa1 = this->a1 - p;
Vector pa2 = this->a2 - p;
Vector pa3 = this->a3 - p;
Vector pa1pa2 = cross(pa1,pa2);
Vector pa2pa3 = cross(pa2,pa3);
Vector pa3pa1 = cross(pa3,pa1);
char best = bestCoord(pa1pa2);
switch (best) {
case 'x':
if ((pa1pa2.x > 0 && pa2pa3.x > 0 && pa3pa1.x > 0)
|| (pa1pa2.x < 0 && pa2pa3.x < 0 && pa3pa1.x < 0))
{
return t;
} else {
return -1;
}
case 'y':
if ((pa1pa2.y > 0 && pa2pa3.y > 0 && pa3pa1.y > 0)
|| (pa1pa2.y < 0 && pa2pa3.y < 0 && pa3pa1.y < 0))
{
return t;
} else {
return -1;
}
case 'z':
if ((pa1pa2.z > 0 && pa2pa3.z > 0 && pa3pa1.z > 0)
|| (pa1pa2.z < 0 && pa2pa3.z < 0 && pa3pa1.z < 0))
{
return t;
} else {
return -1;
}
default:
cerr << "How?";
};
}
return -1;
}

18
CS4451/proj1/functions.h Normal file
View File

@@ -0,0 +1,18 @@
#ifndef _FUNCTIONS_H_
#define _FUNCTIONS_H_
/*void printObject(Point p);
void printObject(Vector v);
void printObject(int i);
void printObject(double f);
void printObject(Light l);
void printObject(MaterialAttributes attrib);
void scanInput(Point &point, char* input);
void scanInput(MaterialAttributes &attrib, char* input);
void scanInput(vector<Primitive*> &primitives, int numPrimitives, char* input);
void scanInput(Vector &v, char* input);
void scanInput(Light &light, char* input);
double length(Point p, Point p2);*/
#endif

61
CS4451/proj1/image.cpp Normal file
View File

@@ -0,0 +1,61 @@
#include <math.h>
#include <iostream>
#include <stdlib.h>
#include <vector>
#include "defs.h"
#include "functions.h"
/* ----------- functionality of image class ---------- */
image::image ( int m, int n ) : xsize(m), ysize(n)
{
rgb = new RGB[m*n];
}
/* ----------------------- */
RGB &image::pixel ( int i, int j )
{
return rgb[i+xsize*j];
}
/* ----------------------- */
int clampnround ( double x )
{
if (x>255)
x = 255;
if (x<0)
x = 0;
return (int)floor(x+.5);
}
ostream &operator<< ( ostream &ofs, RGB c )
{
int rgb[3];
rgb[0] = clampnround(255*c.r);
rgb[1] = clampnround(255*c.g);
rgb[2] = clampnround(255*c.b);
ofs << rgb[0] << " " << rgb[1] << " " << rgb[2] << endl;
return ofs;
}
ostream &operator<< ( ostream &ofs, image i )
{
int x,y;
ofs << "P3" << endl;
ofs << i.xsize << " " << i.ysize << endl;
ofs << "255" << endl;
for ( y=i.ysize-1; y>=0; y-- )
for ( x=0; x<i.xsize; x++ )
ofs << i.pixel(x,y);
return ofs;
}
/* -------- </image class> --------*/

123
CS4451/proj1/proj1.c Normal file
View File

@@ -0,0 +1,123 @@
/*
put your name here, just in case ****
Project 1: Ray Tracing
CS4451A, Spring 2005
*/
#include <math.h>
#include <fstream.h>
#include <iostream.h>
#include <stdlib.h>
#include <vector.h>
#include "defs.h"
#include "functions.h"
/* ------------- Main ------------ */
int main ( )
{
/* First, get the necessary data */
int m, n; // specify the output image size, assuming m x n
Point e, l; // viewpoint e, lower left corner l
Vector h, v; // vectors vertical and horizontal edges
Light light; // Light source
float ambience; // Ambient light intensity
int numPrimitives; // Number of Primitives
vector<Primitive> primitives;
/* ------------ Scan Input ---------------- */
/* Begin scanning the input assuming 80 column lines */
char* input = (char*)malloc(sizeof(char) * 81);
char* pEnd;
//Get m and n
cin.getline(input, 81);
m = strtol(input, &pEnd, 10);
n = strtol(pEnd,NULL,10);
#ifdef bDebug
printObject(m);
printObject(n);
#endif
//Get e
scanInput(e,input);
#ifdef bDebug
printObject(e);
#endif
//Get l
scanInput(l,input);
#ifdef bDebug
printObject(l);
#endif
//Get h
scanInput(h,input);
#ifdef bDebug
printObject(h);
#endif
//Get v
scanInput(v,input);
#ifdef bDebug
printObject(v);
#endif
//Get Light
scanInput(light,input);
#ifdef bDebug
printObject(light);
#endif
//Get ambient light level
cin.getline(input,81);
ambience = strtof(input, NULL);
#ifdef bDebug
printObject(ambience);
#endif
//Get Primitive count
cin.getline(input,81);
numPrimitives = strtol(input,NULL,10);
primitives.resize(numPrimitives);
#ifdef bDebug
printObject(numPrimitives);
#endif
scanInput(primitives,numPrimitives, input);
/* ------------ Do the actual raytracing ---------------- */
#if 0
int x,y;
/* create a little example.... */
image img(256,256);
for ( x=0; x<256; x++ ) {
for ( y=0; y<256; y++ )
{
RGB &pix = img.pixel(x,y);
/* call your raytracer here, then assign the rgb values
it returns to the pixel */
pix.r = x/255.0;
pix.g = y/255.0;
pix.b = (2-(x/255.0+y/255.0))/2;
}
}
/* dump the image to standard output */
cout << img;
#endif
return 0;
}

136
CS4451/proj1/proj1.cpp Normal file
View File

@@ -0,0 +1,136 @@
/*
put your name here, just in case ****
Project 1: Ray Tracing
CS4451A, Spring 2005
*/
#include <math.h>
#include <iostream>
#include <stdlib.h>
#include <vector>
#include "defs.h"
#include "functions.h"
#include <thread>
#include <mutex>
#include <chrono>
/* ------------- Main ------------ */
static void DoRayTraceST(RayTracer &tracer, image &img)
{
//RayTracer tracer;
for (int x = 0; x < tracer.m; x++) {
for (int y = 0; y < tracer.n; y++)
{
RGB& pix = img.pixel(x, y);
tracer.getPixelAt(x, y, pix);
}
}
}
static void DoRayTraceMT(RayTracer& tracer, image& img)
{
static mutex lock;
static int currentColumn;
currentColumn = 0;
auto threadFunc = [&]() {
int x = 0;
while (true)
{
lock.lock();
x = currentColumn;
currentColumn++;
lock.unlock();
if (!(x < tracer.m)) break;
for (int y = 0; y < tracer.n; y++)
{
RGB& pix = img.pixel(x, y);
tracer.getPixelAt(x, y, pix);
}
} ;
};
const auto threadCount = std::thread::hardware_concurrency();
std::vector<std::thread> threads;
threads.reserve(threadCount);
for (unsigned int i = 0; i < threadCount; i++)
{
threads.push_back(std::thread(threadFunc));
}
for (auto& t : threads)
{
t.join();
}
}
int main (int argc, char **argv )
{
using namespace std;
/* First, get the necessary data */
RayTracer tracer;
/* Begin scanning the input assuming 80 column lines */
char* input = (char*)malloc(sizeof(char) * 81);
char* pEnd;
//Get m and n
cin.getline(input, 81);
tracer.m = strtol(input, &pEnd, 10);
tracer.n = strtol(pEnd,NULL,10);
//Get e
scanInput(tracer.e,input);
//Get l
scanInput(tracer.l,input);
//Get h
scanInput(tracer.h,input);
//Get v
scanInput(tracer.v,input);
//Get Light
scanInput(tracer.light,input);
//Get ambient light level
cin.getline(input,81);
tracer.ambience = strtod(input, NULL);
//Get Primitives
cin.getline(input,81);
tracer.numPrimitives = strtol(input,NULL,10);
scanInput(tracer.primitives,tracer.numPrimitives, input);
/* ------------ Do the actual raytracing ---------------- */
image img(tracer.m,tracer.n);
auto start = std::chrono::high_resolution_clock::now();
if (true || argc > 1)
{
cerr << "Starting MT ray trace." << std::endl;
DoRayTraceMT(tracer, img);
}
else
{
cerr << "Starting ST ray trace." << std::endl;
DoRayTraceST(tracer, img);
}
auto end = std::chrono::high_resolution_clock::now();
std::chrono::duration<double> diff = end - start;
cerr << "Time to generate image: " << diff.count() * 1000 << " ms." << std::endl;
/* dump the image to standard output */
cout << img;
return 0;
}

BIN
CS4451/proj1/proj1.pdf Normal file

Binary file not shown.

BIN
CS4451/proj1/proj1.tar.tar Normal file

Binary file not shown.

View File

@@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.5.33516.290
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "proj1_vs", "proj1_vs.vcxproj", "{79ED86D3-8C58-44BE-9E85-BD80B3D562E1}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{79ED86D3-8C58-44BE-9E85-BD80B3D562E1}.Debug|x64.ActiveCfg = Debug|x64
{79ED86D3-8C58-44BE-9E85-BD80B3D562E1}.Debug|x64.Build.0 = Debug|x64
{79ED86D3-8C58-44BE-9E85-BD80B3D562E1}.Debug|x86.ActiveCfg = Debug|Win32
{79ED86D3-8C58-44BE-9E85-BD80B3D562E1}.Debug|x86.Build.0 = Debug|Win32
{79ED86D3-8C58-44BE-9E85-BD80B3D562E1}.Release|x64.ActiveCfg = Release|x64
{79ED86D3-8C58-44BE-9E85-BD80B3D562E1}.Release|x64.Build.0 = Release|x64
{79ED86D3-8C58-44BE-9E85-BD80B3D562E1}.Release|x86.ActiveCfg = Release|Win32
{79ED86D3-8C58-44BE-9E85-BD80B3D562E1}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {FCC5BD28-9AD4-4CF3-914C-1EAC0BB1D994}
EndGlobalSection
EndGlobal

View File

@@ -0,0 +1,146 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{79ed86d3-8c58-44be-9e85-bd80b3d562e1}</ProjectGuid>
<RootNamespace>proj1vs</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<Optimization>Full</Optimization>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\functions.cpp" />
<ClCompile Include="..\image.cpp" />
<ClCompile Include="..\proj1.cpp" />
<ClCompile Include="..\ray.cpp" />
<ClCompile Include="..\raytracer.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\defs.h" />
<ClInclude Include="..\functions.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\functions.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\image.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\proj1.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\ray.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\raytracer.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\defs.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\functions.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>

38
CS4451/proj1/ray.cpp Normal file
View File

@@ -0,0 +1,38 @@
#include <math.h>
#include <ostream>
#include <stdlib.h>
#include <vector>
#include "defs.h"
#include "functions.h"
Ray::Ray (Point start, Point end) {
this->direction = (end-start);
this->origin = end;
}
Ray Ray::operator+(Ray &other) {
Ray r;
r.direction = direction + other.direction;
r.origin = origin + other.origin;
return r;
}
Ray Ray::operator-(Ray &other) {
Ray r;
r.direction = direction - other.direction;
r.origin = origin - other.origin;
return r;
}

163
CS4451/proj1/raytracer.cpp Normal file
View File

@@ -0,0 +1,163 @@
#include <math.h>
#include <iostream>
#include <stdlib.h>
#include <vector>
#include "defs.h"
#include "functions.h"
void RayTracer::getPixelAt(int x, int y, RGB& pixel) {
Point p = l;
double xscale = ((double) x) / this->m;
double yscale = ((double) y) / this->n;
p.x = p.x + h.x *(xscale);
p.y = p.y + h.y *(xscale);
p.z = p.z + h.z *(xscale);
p.x = p.x + v.x *(yscale);
p.y = p.y + v.y *(yscale);
p.z = p.z + v.z *(yscale);
//Now that we have p, we need to get the Ray that goes from
//the viewpoint to the point
Ray ray;
ray.direction = p-e;
ray.origin = p;
//Now that we have the ray, let's see if it intersects anything
vector<Primitive*>::iterator theIterator, index;
double t=-1, temp;
for( theIterator = primitives.begin(); theIterator != primitives.end();
theIterator++ )
{
temp = (*theIterator)->intersectsWith(ray);
if (temp >= 0 && (temp < t || t < 0)) {
index = theIterator;
t = temp;
}
}
/* Add intensity code */
if (t >= 0) {
Point p = (ray.direction*t) + ray.origin;
Ray L;
L.direction = light.center-p;
L.origin = p;
double shadowT;
//Check if it is in shadow
for (theIterator = primitives.begin(); theIterator != primitives.end();
theIterator++)
{
if (theIterator == index) {
continue;
}
shadowT = (*theIterator)->intersectsWith(L);
if (shadowT > 0 && shadowT < 1) {
//object intersected, don't bother continuing
pixel.r = (*index)->attrib.k_ar * ambience;
pixel.g = (*index)->attrib.k_ag * ambience;
pixel.b = (*index)->attrib.k_ab * ambience;
return;
}
}
//nothing found, check for self intersection
if ((*index)->intersectsWithSelf(p, this->light, this->e)) {
pixel.r = (*index)->attrib.k_ar * ambience;
pixel.g = (*index)->attrib.k_ag * ambience;
pixel.b = (*index)->attrib.k_ab * ambience;
} else {
double temp;
Vector V, N, R;
/*pixel.r = (*index)->attrib.k_ar * ambience
+ (*index)->attrib.k_dr * this->light.intensity;
pixel.g = (*index)->attrib.k_ag * ambience
+ (*index)->attrib.k_dg * this->light.intensity;
pixel.b = (*index)->attrib.k_ab * ambience
+ (*index)->attrib.k_db * this->light.intensity;
*/
//Calculate the R, V, and L vectors
//We have L, but it needs to be converted to a unit vector
//L.direction = L.direction / length(L.direction);
temp = length(L.direction);
L.direction.x /= temp;
L.direction.y /= temp;
L.direction.z /= temp;
V = e-p;
temp = length(V);
V.x /= temp;
V.y /= temp;
V.z /= temp;
/*V.x /= -1*temp;
V.y /= -1*temp;
V.z /= -1*temp;*/
N = (*index)->normal(p,light);
temp = length(N);
N.x /= temp;
N.y /= temp;
N.z /= temp;
//diffuse
pixel.r = (*index)->attrib.k_dr * this->light.intensity
* dot(N,L.direction);
pixel.g = (*index)->attrib.k_dg * this->light.intensity
* dot(N,L.direction);
pixel.b = (*index)->attrib.k_db * this->light.intensity
* dot(N,L.direction);
//specular
R.x = (-1*L.direction.x)+(2.*((dot(N,L.direction)) * N.x));
R.y = (-1*L.direction.y)+(2.*((dot(N,L.direction)) * N.y));
R.z = (-1*L.direction.z)+(2.*((dot(N,L.direction)) * N.z));
pixel.r +=
(*index)->attrib.k_s * pow(max((double)0,dot(R,V)),(*index)->attrib.n_spec) * this->light.intensity;
pixel.g +=
(*index)->attrib.k_s * pow(max((double)0,dot(R,V)),(*index)->attrib.n_spec) * this->light.intensity;
pixel.b +=
(*index)->attrib.k_s * pow(max((double)0,dot(R,V)),(*index)->attrib.n_spec) * this->light.intensity;
//calculate distance from light for attenuation
/*double r = length(this->light.center - p);
pixel.r *= (1./(pow(r,((double)2)) + r));
pixel.g *= (1./(pow(r,((double)2)) + r));
pixel.b *= (1./(pow(r,((double)2)) + r));*/
//add ambient
pixel.r += (*index)->attrib.k_ar * ambience ;
pixel.g += (*index)->attrib.k_ag * ambience ;
pixel.b += (*index)->attrib.k_ab * ambience ;
return;
}
} else {
pixel.r = 0;
pixel.g = 0;
pixel.b = 0;
}
}