summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Schiffer <matthias@gamezock.de>2010-04-16 03:08:48 +0200
committerMatthias Schiffer <matthias@gamezock.de>2010-04-16 03:08:48 +0200
commita19dc0d6aa982d138f46305cdea6443cb45a5fd3 (patch)
treeeb846615b4d22e2f1e76272b1460cc879f52f937
parent5951108c0a47fed6d78e442ae4233d9d34eafe13 (diff)
downloadhtanks-a19dc0d6aa982d138f46305cdea6443cb45a5fd3.tar
htanks-a19dc0d6aa982d138f46305cdea6443cb45a5fd3.zip
Added more models and render with perspective transform now
-rw-r--r--.gitignore1
-rw-r--r--model/bullet.blendbin0 -> 145396 bytes
-rw-r--r--model/bullet.obj657
-rw-r--r--model/cube.blendbin0 -> 138032 bytes
-rw-r--r--model/cube.mtl11
-rw-r--r--model/cube.obj427
-rw-r--r--src/GLX.hs9
-rw-r--r--src/HTanks.hs8
-rw-r--r--src/Model.hs4
-rw-r--r--src/Render.hs76
10 files changed, 1156 insertions, 37 deletions
diff --git a/.gitignore b/.gitignore
index 733412c..b203cf3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
*~
dist
+*.blend1
diff --git a/model/bullet.blend b/model/bullet.blend
new file mode 100644
index 0000000..de08143
--- /dev/null
+++ b/model/bullet.blend
Binary files differ
diff --git a/model/bullet.obj b/model/bullet.obj
new file mode 100644
index 0000000..7e8de49
--- /dev/null
+++ b/model/bullet.obj
@@ -0,0 +1,657 @@
+# Blender3D v249 OBJ File: bullet.blend
+# www.blender3d.org
+o Circle
+v 0.035355 -0.000000 -0.035355
+v 0.046194 -0.000000 -0.019134
+v 0.050000 0.000000 0.000000
+v 0.046194 0.000000 0.019134
+v 0.035355 0.000000 0.035355
+v 0.019134 0.000000 0.046194
+v 0.000000 0.000000 0.050000
+v -0.019134 0.000000 0.046194
+v -0.035355 0.000000 0.035355
+v -0.046194 0.000000 0.019134
+v -0.050000 -0.000000 -0.000000
+v -0.046194 -0.000000 -0.019134
+v -0.035355 -0.000000 -0.035355
+v -0.019134 -0.000000 -0.046194
+v 0.000000 -0.000000 -0.050000
+v 0.019134 -0.000000 -0.046194
+v 0.035355 0.019620 -0.035355
+v 0.046194 0.019620 -0.019134
+v 0.050000 0.019620 0.000000
+v 0.046194 0.019620 0.019134
+v 0.035355 0.019620 0.035355
+v 0.019134 0.019620 0.046194
+v 0.000000 0.019620 0.050000
+v -0.019134 0.019620 0.046194
+v -0.035355 0.019620 0.035355
+v -0.046194 0.019620 0.019134
+v -0.050000 0.019620 -0.000000
+v -0.046194 0.019620 -0.019134
+v -0.035355 0.019620 -0.035355
+v -0.019134 0.019620 -0.046194
+v 0.000000 0.019620 -0.050000
+v 0.019134 0.019620 -0.046194
+v 0.028321 0.019620 -0.028321
+v 0.037004 0.019620 -0.015327
+v 0.040053 0.019620 0.000000
+v 0.037004 0.019620 0.015327
+v 0.028321 0.019620 0.028321
+v 0.015327 0.019620 0.037004
+v 0.000000 0.019620 0.040053
+v -0.015327 0.019620 0.037004
+v -0.028321 0.019620 0.028321
+v -0.037004 0.019620 0.015327
+v -0.040053 0.019620 -0.000000
+v -0.037004 0.019620 -0.015327
+v -0.028321 0.019620 -0.028321
+v -0.015327 0.019620 -0.037004
+v 0.000000 0.019620 -0.040053
+v 0.015327 0.019620 -0.037004
+v 0.037004 0.036977 -0.015327
+v 0.028321 0.036977 -0.028321
+v 0.040053 0.036977 0.000000
+v 0.037004 0.036977 0.015327
+v 0.028321 0.036977 0.028321
+v 0.015327 0.036977 0.037004
+v 0.000000 0.036977 0.040053
+v -0.015327 0.036977 0.037004
+v -0.028321 0.036977 0.028321
+v -0.037004 0.036977 0.015327
+v -0.040053 0.036977 -0.000000
+v -0.037004 0.036977 -0.015327
+v -0.028321 0.036977 -0.028321
+v -0.015327 0.036977 -0.037004
+v 0.000000 0.036977 -0.040053
+v 0.015327 0.036977 -0.037004
+v 0.036574 0.036977 -0.036574
+v 0.047786 0.036977 -0.019794
+v 0.051723 0.036977 0.000000
+v 0.047786 0.036977 0.019794
+v 0.036574 0.036977 0.036574
+v 0.019794 0.036977 0.047786
+v 0.000000 0.036977 0.051723
+v -0.019794 0.036977 0.047786
+v -0.036574 0.036977 0.036574
+v -0.047786 0.036977 0.019794
+v -0.051723 0.036977 -0.000000
+v -0.047786 0.036977 -0.019794
+v -0.036574 0.036977 -0.036574
+v -0.019794 0.036977 -0.047786
+v 0.000000 0.036977 -0.051723
+v 0.019794 0.036977 -0.047786
+v 0.047786 0.131305 -0.019794
+v 0.036574 0.131305 -0.036574
+v 0.051723 0.131305 -0.000000
+v 0.047786 0.131305 0.019794
+v 0.036574 0.131305 0.036574
+v 0.019794 0.131305 0.047786
+v 0.000000 0.131305 0.051723
+v -0.019794 0.131305 0.047786
+v -0.036574 0.131305 0.036574
+v -0.047786 0.131305 0.019794
+v -0.051723 0.131305 -0.000000
+v -0.047786 0.131305 -0.019794
+v -0.036574 0.131305 -0.036574
+v -0.019794 0.131305 -0.047786
+v 0.000000 0.131305 -0.051723
+v 0.019794 0.131305 -0.047786
+v 0.029520 0.156208 -0.029520
+v 0.038570 0.156208 -0.015976
+v 0.041747 0.156208 -0.000000
+v 0.038570 0.156208 0.015976
+v 0.029520 0.156208 0.029520
+v 0.015976 0.156208 0.038570
+v 0.000000 0.156208 0.041747
+v -0.015976 0.156208 0.038570
+v -0.029520 0.156208 0.029520
+v -0.038570 0.156208 0.015976
+v -0.041747 0.156208 -0.000000
+v -0.038570 0.156208 -0.015976
+v -0.029520 0.156208 -0.029520
+v -0.015976 0.156208 -0.038570
+v 0.000000 0.156208 -0.041747
+v 0.015976 0.156208 -0.038570
+v 0.016971 0.174319 -0.016971
+v 0.022174 0.174319 -0.009185
+v 0.024001 0.174319 -0.000000
+v 0.022174 0.174319 0.009185
+v 0.016971 0.174319 0.016971
+v 0.009185 0.174319 0.022174
+v 0.000000 0.174319 0.024001
+v -0.009185 0.174319 0.022174
+v -0.016971 0.174319 0.016971
+v -0.022174 0.174319 0.009185
+v -0.024001 0.174319 -0.000000
+v -0.022174 0.174319 -0.009185
+v -0.016971 0.174319 -0.016971
+v -0.009185 0.174319 -0.022174
+v 0.000000 0.174319 -0.024001
+v 0.009185 0.174319 -0.022174
+v 0.000000 0.182620 -0.000000
+v 0.000000 0.000000 0.000000
+vt 0.442348 0.723517
+vt 0.486308 0.831276
+vt 0.418328 0.734761
+vt 0.395167 0.750823
+vt 0.373643 0.774765
+vt 0.355531 0.806014
+vt 0.344085 0.847527
+vt 0.345069 0.900493
+vt 0.631555 0.864578
+vt 0.625044 0.921431
+vt 0.622930 0.819506
+vt 0.606315 0.784119
+vt 0.585782 0.758952
+vt 0.563073 0.740060
+vt 0.539419 0.727158
+vt 0.515323 0.719335
+vt 0.490992 0.716078
+vt 0.466625 0.717152
+vt 0.435373 0.277216
+vt 0.403973 0.264260
+vt 0.500079 0.097230
+vt 0.370265 0.246237
+vt 0.335730 0.219943
+vt 0.300081 0.182134
+vt 0.262476 0.125117
+vt 0.216974 0.025934
+vt 0.778332 0.030350
+vt 0.738758 0.123675
+vt 0.701168 0.180870
+vt 0.664816 0.219670
+vt 0.629820 0.246695
+vt 0.596015 0.265220
+vt 0.563142 0.277262
+vt 0.530889 0.284061
+vt 0.498888 0.286402
+vt 0.466847 0.284667
+vt 0.459076 0.657593
+vt 0.425050 0.662927
+vt 0.492525 0.656254
+vt 0.526268 0.659145
+vt 0.560395 0.666499
+vt 0.595895 0.678983
+vt 0.633372 0.697880
+vt 0.672738 0.726412
+vt 0.715266 0.766419
+vt 0.758543 0.827819
+vt 0.799890 0.921453
+vt 0.187806 0.885604
+vt 0.230129 0.805500
+vt 0.272531 0.751734
+vt 0.313481 0.714767
+vt 0.352656 0.690394
+vt 0.389517 0.673219
+vt 0.454967 0.604740
+vt 0.415050 0.607973
+vt 0.493828 0.603607
+vt 0.532820 0.605524
+vt 0.573377 0.611385
+vt 0.616082 0.620340
+vt 0.662800 0.633827
+vt 0.716953 0.655882
+vt 0.778810 0.684490
+vt 0.857426 0.732283
+vt 0.960309 0.806764
+vt 0.057122 0.775946
+vt 0.144127 0.716184
+vt 0.215313 0.674136
+vt 0.275173 0.645576
+vt 0.325884 0.628063
+vt 0.372403 0.614745
+vt 0.454414 0.411584
+vt 0.410358 0.408623
+vt 0.497682 0.413327
+vt 0.541389 0.413677
+vt 0.586156 0.410672
+vt 0.633149 0.407708
+vt 0.685877 0.402631
+vt 0.746282 0.392320
+vt 0.815042 0.377662
+vt 0.895950 0.356644
+vt 0.995142 0.323746
+vt 0.011842 0.328297
+vt 0.111950 0.356544
+vt 0.190537 0.373008
+vt 0.257165 0.387893
+vt 0.313761 0.396372
+vt 0.364103 0.403965
+vt 0.456937 0.383080
+vt 0.413987 0.379535
+vt 0.498747 0.385110
+vt 0.540505 0.383766
+vt 0.583838 0.382503
+vt 0.629454 0.375367
+vt 0.679524 0.364508
+vt 0.736206 0.351371
+vt 0.800809 0.330810
+vt 0.875776 0.303252
+vt 0.958165 0.266489
+vt 0.046418 0.264682
+vt 0.129767 0.300477
+vt 0.203269 0.329077
+vt 0.266294 0.346593
+vt 0.320660 0.364084
+vt 0.369024 0.373744
+vt 0.460561 0.338929
+vt 0.422574 0.332644
+vt 0.498173 0.341211
+vt 0.536405 0.339836
+vt 0.575642 0.334995
+vt 0.616907 0.325682
+vt 0.661410 0.311265
+vt 0.711247 0.291253
+vt 0.764908 0.259158
+vt 0.827888 0.217071
+vt 0.907128 0.167677
+vt 0.091213 0.167936
+vt 0.169329 0.215271
+vt 0.235118 0.254654
+vt 0.288750 0.286234
+vt 0.336602 0.308830
+vt 0.380534 0.325355
+vt 0.462452 0.318040
+vt 0.426722 0.312070
+vt 0.497797 0.320014
+vt 0.533811 0.318275
+vt 0.570605 0.312568
+vt 0.608932 0.302035
+vt 0.649660 0.285578
+vt 0.693702 0.261242
+vt 0.743464 0.226984
+vt 0.800880 0.178871
+vt 0.884225 0.108849
+vt 0.118541 0.109644
+vt 0.198644 0.175916
+vt 0.254967 0.224836
+vt 0.303820 0.258704
+vt 0.347531 0.283186
+vt 0.388815 0.300133
+vn 0.384594 0.819025 -0.425703
+vn 0.000000 1.000000 0.000000
+vn 0.553056 0.801019 -0.229072
+vn 0.534013 0.845454 0.000000
+vn 0.553056 0.801019 0.229072
+vn 0.384594 0.819025 0.425703
+vn 0.192419 0.819025 0.540483
+vn -0.029054 0.819025 0.572985
+vn -0.246101 0.819025 0.518235
+vn -0.425703 0.819025 0.384594
+vn -0.540483 0.819025 0.192419
+vn -0.572985 0.819025 -0.029054
+vn -0.518235 0.819025 -0.246101
+vn -0.384594 0.819025 -0.425703
+vn -0.192419 0.819025 -0.540483
+vn 0.029054 0.819025 -0.572985
+vn 0.204352 0.845454 -0.493362
+vn 0.622639 -0.561296 -0.545183
+vn 0.646901 -0.713920 -0.267953
+vn 0.000000 -1.000000 0.000000
+vn 0.825770 -0.561296 -0.054750
+vn 0.783868 -0.561296 0.265419
+vn 0.622639 -0.561296 0.545183
+vn 0.366588 -0.561296 0.741966
+vn 0.054750 -0.561296 0.825770
+vn -0.265419 -0.561296 0.783868
+vn -0.545183 -0.561296 0.622639
+vn -0.741966 -0.561296 0.366588
+vn -0.825770 -0.561296 0.054750
+vn -0.783868 -0.561296 -0.265419
+vn -0.622608 -0.561296 -0.545183
+vn -0.366588 -0.561296 -0.741966
+vn -0.054750 -0.561296 -0.825770
+vn 0.340922 -0.454176 -0.823084
+vn 0.305734 0.601337 -0.738151
+vn 0.586932 0.546983 -0.596881
+vn 0.007019 0.546983 -0.837092
+vn -0.313822 0.546983 -0.776055
+vn -0.586932 0.546983 -0.596881
+vn -0.770653 0.546983 -0.326853
+vn -0.837092 0.546983 -0.007019
+vn -0.776055 0.546983 0.313822
+vn -0.596881 0.546983 0.586932
+vn -0.326853 0.546983 0.770653
+vn -0.007019 0.546983 0.837092
+vn 0.313822 0.546983 0.776055
+vn 0.586932 0.546983 0.596881
+vn 0.805261 0.490127 0.333537
+vn 0.798975 0.601337 0.000000
+vn 0.805261 0.490127 -0.333537
+vn 0.370312 0.252174 -0.894009
+vn 0.692618 0.189581 -0.695914
+vn 0.002319 0.189581 -0.981842
+vn -0.373577 0.189581 -0.907987
+vn -0.692618 0.189581 -0.695914
+vn -0.906217 0.189581 -0.377880
+vn -0.981842 0.189581 -0.002319
+vn -0.907987 0.189581 0.373577
+vn -0.695914 0.189581 0.692618
+vn -0.377880 0.189581 0.906217
+vn -0.002319 0.189581 0.981842
+vn 0.373577 0.189581 0.907987
+vn 0.692618 0.189581 0.695914
+vn 0.896969 0.151463 0.415265
+vn 0.975829 0.216468 0.028871
+vn 0.916471 0.126194 -0.379620
+vn 0.527360 -0.713157 -0.461776
+vn -0.039247 -0.804895 -0.592059
+vn -0.527360 -0.713157 -0.461776
+vn -0.663961 -0.713157 -0.224799
+vn -0.699454 -0.713157 0.046358
+vn -0.628468 -0.713157 0.310495
+vn -0.461776 -0.713157 0.527360
+vn -0.224799 -0.713157 0.663961
+vn 0.046358 -0.713157 0.699454
+vn 0.310495 -0.713157 0.628468
+vn 0.527360 -0.713157 0.461776
+vn 0.663961 -0.713157 0.224799
+vn 0.592059 -0.804895 -0.039247
+vn 0.505570 -0.836940 -0.209418
+vn 0.168493 -0.897824 -0.406781
+vn 0.461776 -0.713157 -0.527360
+vn 0.054750 -0.561296 -0.825770
+vn -0.190283 -0.804895 -0.562029
+vn -0.461776 -0.713157 -0.527360
+vn -0.628468 -0.713157 -0.310495
+vn -0.699454 -0.713157 -0.046358
+vn -0.663961 -0.713157 0.224799
+vn -0.527360 -0.713157 0.461776
+vn -0.310495 -0.713157 0.628468
+vn -0.046358 -0.713157 0.699454
+vn 0.224799 -0.713157 0.663961
+vn 0.461776 -0.713157 0.527360
+vn 0.628468 -0.713157 0.310495
+vn 0.825770 -0.561296 0.054750
+vn 0.733879 -0.607440 -0.303964
+vn 0.340922 0.454176 -0.823084
+vn 0.527360 0.713157 -0.461776
+vn -0.046358 0.713157 -0.699454
+vn -0.310495 0.713157 -0.628468
+vn -0.527360 0.713157 -0.461776
+vn -0.663961 0.713157 -0.224799
+vn -0.699454 0.713157 0.046358
+vn -0.628468 0.713157 0.310495
+vn -0.461776 0.713157 0.527360
+vn -0.224799 0.713157 0.663961
+vn 0.046358 0.713157 0.699454
+vn 0.310495 0.713157 0.628468
+vn 0.527360 0.713157 0.461776
+vn 0.663961 0.713157 0.224799
+vn 0.699454 0.713157 -0.046358
+vn 0.406781 0.897824 -0.168493
+vn 0.168493 0.897824 -0.406781
+vn 0.461776 0.713157 -0.527360
+vn 0.046358 0.713157 -0.699454
+vn -0.224799 0.713157 -0.663961
+vn -0.461776 0.713157 -0.527360
+vn -0.628468 0.713157 -0.310495
+vn -0.699454 0.713157 -0.046358
+vn -0.663961 0.713157 0.224799
+vn -0.527360 0.713157 0.461776
+vn -0.310495 0.713157 0.628468
+vn -0.046358 0.713157 0.699454
+vn 0.224799 0.713157 0.663961
+vn 0.461776 0.713157 0.527360
+vn 0.628468 0.713157 0.310495
+vn 0.699454 0.713157 0.046358
+vn 0.823084 0.454176 -0.340922
+usemtl None_Untitled
+s 1
+f 113/1/1 129/2/2 114/3/3
+f 115/4/4 114/3/3 129/2/2
+f 116/5/5 115/4/4 129/2/2
+f 117/6/6 116/5/5 129/2/2
+f 118/7/7 117/6/6 129/2/2
+f 119/8/8 118/7/7 129/2/2
+f 120/9/9 119/10/8 129/2/2
+f 121/11/10 120/9/9 129/2/2
+f 122/12/11 121/11/10 129/2/2
+f 123/13/12 122/12/11 129/2/2
+f 124/14/13 123/13/12 129/2/2
+f 125/15/14 124/14/13 129/2/2
+f 126/16/15 125/15/14 129/2/2
+f 127/17/16 126/16/15 129/2/2
+f 128/18/17 127/17/16 129/2/2
+f 128/18/17 129/2/2 113/1/1
+f 1/19/18 2/20/19 130/21/20
+f 2/20/19 3/22/21 130/21/20
+f 3/22/21 4/23/22 130/21/20
+f 4/23/22 5/24/23 130/21/20
+f 5/24/23 6/25/24 130/21/20
+f 6/25/24 7/26/25 130/21/20
+f 7/27/25 8/28/26 130/21/20
+f 8/28/26 9/29/27 130/21/20
+f 9/29/27 10/30/28 130/21/20
+f 10/30/28 11/31/29 130/21/20
+f 11/31/29 12/32/30 130/21/20
+f 12/32/30 13/33/31 130/21/20
+f 13/33/31 14/34/32 130/21/20
+f 14/34/32 15/35/33 130/21/20
+f 15/35/33 16/36/34 130/21/20
+f 16/36/34 1/19/18 130/21/20
+f 112/37/35 128/18/17 113/1/1
+f 112/37/35 113/1/1 97/38/36
+f 112/37/35 111/39/37 127/17/16
+f 112/37/35 127/17/16 128/18/17
+f 111/39/37 110/40/38 126/16/15
+f 111/39/37 126/16/15 127/17/16
+f 110/40/38 109/41/39 125/15/14
+f 110/40/38 125/15/14 126/16/15
+f 109/41/39 108/42/40 124/14/13
+f 109/41/39 124/14/13 125/15/14
+f 108/42/40 107/43/41 123/13/12
+f 108/42/40 123/13/12 124/14/13
+f 107/43/41 106/44/42 122/12/11
+f 107/43/41 122/12/11 123/13/12
+f 106/44/42 105/45/43 121/11/10
+f 106/44/42 121/11/10 122/12/11
+f 105/45/43 104/46/44 120/9/9
+f 105/45/43 120/9/9 121/11/10
+f 104/46/44 103/47/45 119/10/8
+f 104/46/44 119/10/8 120/9/9
+f 103/48/45 102/49/46 118/7/7
+f 103/48/45 118/7/7 119/8/8
+f 102/49/46 101/50/47 117/6/6
+f 102/49/46 117/6/6 118/7/7
+f 101/50/47 100/51/48 116/5/5
+f 101/50/47 116/5/5 117/6/6
+f 100/51/48 99/52/49 116/5/5
+f 99/52/49 115/4/4 116/5/5
+f 99/52/49 98/53/50 114/3/3
+f 99/52/49 114/3/3 115/4/4
+f 97/38/36 113/1/1 114/3/3
+f 97/38/36 114/3/3 98/53/50
+f 96/54/51 112/37/35 97/38/36
+f 96/54/51 97/38/36 82/55/52
+f 96/54/51 95/56/53 111/39/37
+f 96/54/51 111/39/37 112/37/35
+f 95/56/53 94/57/54 110/40/38
+f 95/56/53 110/40/38 111/39/37
+f 94/57/54 93/58/55 109/41/39
+f 94/57/54 109/41/39 110/40/38
+f 93/58/55 92/59/56 108/42/40
+f 93/58/55 108/42/40 109/41/39
+f 92/59/56 91/60/57 107/43/41
+f 92/59/56 107/43/41 108/42/40
+f 91/60/57 90/61/58 106/44/42
+f 91/60/57 106/44/42 107/43/41
+f 90/61/58 89/62/59 105/45/43
+f 90/61/58 105/45/43 106/44/42
+f 89/62/59 88/63/60 104/46/44
+f 89/62/59 104/46/44 105/45/43
+f 88/63/60 87/64/61 103/47/45
+f 88/63/60 103/47/45 104/46/44
+f 87/65/61 86/66/62 102/49/46
+f 87/65/61 102/49/46 103/48/45
+f 86/66/62 85/67/63 101/50/47
+f 86/66/62 101/50/47 102/49/46
+f 85/67/63 84/68/64 100/51/48
+f 85/67/63 100/51/48 101/50/47
+f 84/68/64 83/69/65 100/51/48
+f 83/69/65 99/52/49 100/51/48
+f 83/69/65 81/70/66 98/53/50
+f 83/69/65 98/53/50 99/52/49
+f 82/55/52 97/38/36 98/53/50
+f 82/55/52 98/53/50 81/70/66
+f 80/71/34 96/54/51 82/55/52
+f 80/71/34 82/55/52 65/72/67
+f 80/71/34 79/73/68 95/56/53
+f 80/71/34 95/56/53 96/54/51
+f 79/73/68 78/74/32 94/57/54
+f 79/73/68 94/57/54 95/56/53
+f 78/74/32 77/75/69 93/58/55
+f 78/74/32 93/58/55 94/57/54
+f 77/75/69 76/76/70 92/59/56
+f 77/75/69 92/59/56 93/58/55
+f 76/76/70 75/77/71 91/60/57
+f 76/76/70 91/60/57 92/59/56
+f 75/77/71 74/78/72 90/61/58
+f 75/77/71 90/61/58 91/60/57
+f 74/78/72 73/79/73 89/62/59
+f 74/78/72 89/62/59 90/61/58
+f 73/79/73 72/80/74 88/63/60
+f 73/79/73 88/63/60 89/62/59
+f 72/80/74 71/81/75 87/64/61
+f 72/80/74 87/64/61 88/63/60
+f 71/82/75 70/83/76 86/66/62
+f 71/82/75 86/66/62 87/65/61
+f 70/83/76 69/84/77 85/67/63
+f 70/83/76 85/67/63 86/66/62
+f 69/84/77 68/85/78 84/68/64
+f 69/84/77 84/68/64 85/67/63
+f 68/85/78 67/86/79 83/69/65
+f 68/85/78 83/69/65 84/68/64
+f 67/86/79 66/87/80 81/70/66
+f 67/86/79 81/70/66 83/69/65
+f 65/72/67 82/55/52 81/70/66
+f 65/72/67 81/70/66 66/87/80
+f 64/88/81 80/71/34 65/72/67
+f 64/88/81 65/72/67 50/89/82
+f 64/88/81 63/90/83 79/73/68
+f 64/88/81 79/73/68 80/71/34
+f 63/90/83 62/91/84 79/73/68
+f 62/91/84 78/74/32 79/73/68
+f 62/91/84 61/92/85 77/75/69
+f 62/91/84 77/75/69 78/74/32
+f 61/92/85 60/93/86 76/76/70
+f 61/92/85 76/76/70 77/75/69
+f 60/93/86 59/94/87 75/77/71
+f 60/93/86 75/77/71 76/76/70
+f 59/94/87 58/95/88 74/78/72
+f 59/94/87 74/78/72 75/77/71
+f 58/95/88 57/96/89 73/79/73
+f 58/95/88 73/79/73 74/78/72
+f 57/96/89 56/97/90 72/80/74
+f 57/96/89 72/80/74 73/79/73
+f 56/97/90 55/98/91 71/81/75
+f 56/97/90 71/81/75 72/80/74
+f 55/99/91 54/100/92 70/83/76
+f 55/99/91 70/83/76 71/82/75
+f 54/100/92 53/101/93 69/84/77
+f 54/100/92 69/84/77 70/83/76
+f 53/101/93 52/102/94 68/85/78
+f 53/101/93 68/85/78 69/84/77
+f 52/102/94 51/103/95 67/86/79
+f 52/102/94 67/86/79 68/85/78
+f 51/103/95 49/104/96 67/86/79
+f 49/104/96 66/87/80 67/86/79
+f 50/89/82 65/72/67 66/87/80
+f 50/89/82 66/87/80 49/104/96
+f 48/105/97 64/88/81 50/89/82
+f 48/105/97 50/89/82 33/106/98
+f 48/105/97 47/107/99 63/90/83
+f 48/105/97 63/90/83 64/88/81
+f 47/107/99 46/108/100 62/91/84
+f 47/107/99 62/91/84 63/90/83
+f 46/108/100 45/109/101 61/92/85
+f 46/108/100 61/92/85 62/91/84
+f 45/109/101 44/110/102 60/93/86
+f 45/109/101 60/93/86 61/92/85
+f 44/110/102 43/111/103 59/94/87
+f 44/110/102 59/94/87 60/93/86
+f 43/111/103 42/112/104 58/95/88
+f 43/111/103 58/95/88 59/94/87
+f 42/112/104 41/113/105 57/96/89
+f 42/112/104 57/96/89 58/95/88
+f 41/113/105 40/114/106 56/97/90
+f 41/113/105 56/97/90 57/96/89
+f 40/114/106 39/115/107 55/98/91
+f 40/114/106 55/98/91 56/97/90
+f 39/116/107 38/117/108 54/100/92
+f 39/116/107 54/100/92 55/99/91
+f 38/117/108 37/118/109 53/101/93
+f 38/117/108 53/101/93 54/100/92
+f 37/118/109 36/119/110 52/102/94
+f 37/118/109 52/102/94 53/101/93
+f 36/119/110 35/120/111 51/103/95
+f 36/119/110 51/103/95 52/102/94
+f 35/120/111 34/121/112 49/104/96
+f 35/120/111 49/104/96 51/103/95
+f 33/106/98 50/89/82 49/104/96
+f 33/106/98 49/104/96 34/121/112
+f 32/122/113 48/105/97 33/106/98
+f 32/122/113 33/106/98 17/123/114
+f 32/122/113 31/124/115 47/107/99
+f 32/122/113 47/107/99 48/105/97
+f 31/124/115 30/125/116 46/108/100
+f 31/124/115 46/108/100 47/107/99
+f 30/125/116 29/126/117 45/109/101
+f 30/125/116 45/109/101 46/108/100
+f 29/126/117 28/127/118 44/110/102
+f 29/126/117 44/110/102 45/109/101
+f 28/127/118 27/128/119 43/111/103
+f 28/127/118 43/111/103 44/110/102
+f 27/128/119 26/129/120 42/112/104
+f 27/128/119 42/112/104 43/111/103
+f 26/129/120 25/130/121 41/113/105
+f 26/129/120 41/113/105 42/112/104
+f 25/130/121 24/131/122 40/114/106
+f 25/130/121 40/114/106 41/113/105
+f 24/131/122 23/132/123 39/115/107
+f 24/131/122 39/115/107 40/114/106
+f 23/133/123 22/134/124 38/117/108
+f 23/133/123 38/117/108 39/116/107
+f 22/134/124 21/135/125 37/118/109
+f 22/134/124 37/118/109 38/117/108
+f 21/135/125 20/136/126 36/119/110
+f 21/135/125 36/119/110 37/118/109
+f 20/136/126 19/137/127 35/120/111
+f 20/136/126 35/120/111 36/119/110
+f 19/137/127 18/138/128 34/121/112
+f 19/137/127 34/121/112 35/120/111
+f 17/123/114 33/106/98 34/121/112
+f 17/123/114 34/121/112 18/138/128
+f 17/123/114 1/19/18 16/36/34
+f 17/123/114 16/36/34 32/122/113
+f 16/36/34 15/35/33 31/124/115
+f 16/36/34 31/124/115 32/122/113
+f 15/35/33 14/34/32 30/125/116
+f 15/35/33 30/125/116 31/124/115
+f 14/34/32 13/33/31 29/126/117
+f 14/34/32 29/126/117 30/125/116
+f 13/33/31 12/32/30 28/127/118
+f 13/33/31 28/127/118 29/126/117
+f 12/32/30 11/31/29 27/128/119
+f 12/32/30 27/128/119 28/127/118
+f 11/31/29 10/30/28 26/129/120
+f 11/31/29 26/129/120 27/128/119
+f 10/30/28 9/29/27 25/130/121
+f 10/30/28 25/130/121 26/129/120
+f 9/29/27 8/28/26 24/131/122
+f 9/29/27 24/131/122 25/130/121
+f 8/28/26 7/27/25 23/132/123
+f 8/28/26 23/132/123 24/131/122
+f 7/26/25 6/25/24 22/134/124
+f 7/26/25 22/134/124 23/133/123
+f 6/25/24 5/24/23 21/135/125
+f 6/25/24 21/135/125 22/134/124
+f 5/24/23 4/23/22 20/136/126
+f 5/24/23 20/136/126 21/135/125
+f 4/23/22 3/22/21 19/137/127
+f 4/23/22 19/137/127 20/136/126
+f 3/22/21 2/20/19 18/138/128
+f 3/22/21 18/138/128 19/137/127
+f 1/19/18 17/123/114 18/138/128
+f 1/19/18 18/138/128 2/20/19
diff --git a/model/cube.blend b/model/cube.blend
new file mode 100644
index 0000000..af529d0
--- /dev/null
+++ b/model/cube.blend
Binary files differ
diff --git a/model/cube.mtl b/model/cube.mtl
new file mode 100644
index 0000000..5bc3a52
--- /dev/null
+++ b/model/cube.mtl
@@ -0,0 +1,11 @@
+# Material Count: 1
+newmtl Material
+Ns 96.078431
+Ka 0.000000 0.000000 0.000000
+Kd 0.483062 0.483062 0.483062
+Ks 0.500000 0.500000 0.500000
+Ni 1.000000
+d 1.000000
+illum 2
+
+
diff --git a/model/cube.obj b/model/cube.obj
new file mode 100644
index 0000000..838f922
--- /dev/null
+++ b/model/cube.obj
@@ -0,0 +1,427 @@
+# Blender3D v249 OBJ File: cube.blend
+# www.blender3d.org
+o Cube
+v -0.445003 -0.500000 0.445003
+v -0.445003 -0.500000 -0.445003
+v 0.445003 -0.500000 -0.445003
+v 0.445003 -0.500000 0.445003
+v -0.445003 0.500000 0.445003
+v 0.445003 0.500000 0.445003
+v 0.445003 0.500000 -0.445003
+v -0.445003 0.500000 -0.445003
+v 0.500000 0.445003 0.445003
+v 0.500000 -0.445003 0.445003
+v 0.500000 -0.445003 -0.445003
+v 0.500000 0.445003 -0.445003
+v -0.445003 0.445003 0.500000
+v -0.445003 -0.445003 0.500000
+v 0.445003 -0.445003 0.500000
+v 0.445003 0.445003 0.500000
+v -0.500000 0.445003 -0.445003
+v -0.500000 -0.445003 -0.445003
+v -0.500000 -0.445003 0.445003
+v -0.500000 0.445003 0.445003
+v -0.445003 -0.445003 -0.500000
+v -0.445003 0.445003 -0.500000
+v 0.445003 0.445003 -0.500000
+v 0.445003 -0.445003 -0.500000
+v 0.490850 -0.467094 0.445003
+v 0.467094 -0.490850 0.445003
+v 0.467094 -0.490850 -0.445003
+v 0.490850 -0.467094 -0.445003
+v -0.445003 -0.467094 0.490850
+v -0.445003 -0.490850 0.467094
+v 0.445003 -0.490850 0.467094
+v 0.445003 -0.467094 0.490850
+v -0.445003 -0.490850 -0.467094
+v -0.445003 -0.467094 -0.490850
+v 0.445003 -0.467094 -0.490850
+v 0.445003 -0.490850 -0.467094
+v -0.490850 -0.467094 -0.445003
+v -0.467094 -0.490850 -0.445003
+v -0.467094 -0.490850 0.445003
+v -0.490850 -0.467094 0.445003
+v -0.445003 0.467094 -0.490850
+v -0.445003 0.490850 -0.467094
+v 0.445003 0.490850 -0.467093
+v 0.445003 0.467094 -0.490849
+v -0.467094 0.490850 -0.445003
+v -0.490850 0.467094 -0.445003
+v -0.490850 0.467094 0.445003
+v -0.467094 0.490850 0.445003
+v 0.467093 0.490850 0.445003
+v 0.490849 0.467094 0.445003
+v 0.490850 0.467094 -0.445003
+v 0.467094 0.490850 -0.445003
+v -0.445003 0.490850 0.467094
+v -0.445003 0.467094 0.490850
+v 0.445003 0.467094 0.490850
+v 0.445003 0.490850 0.467094
+v 0.467094 0.445003 -0.490849
+v 0.490850 0.445003 -0.467094
+v 0.490850 -0.445003 -0.467094
+v 0.467094 -0.445003 -0.490850
+v 0.490849 0.445003 0.467094
+v 0.467093 0.445003 0.490850
+v 0.467094 -0.445003 0.490850
+v 0.490850 -0.445003 0.467094
+v -0.467094 0.445003 0.490850
+v -0.490850 0.445003 0.467094
+v -0.490850 -0.445003 0.467094
+v -0.467094 -0.445003 0.490850
+v -0.490850 0.445003 -0.467094
+v -0.467094 0.445003 -0.490850
+v -0.467094 -0.445003 -0.490850
+v -0.490850 -0.445003 -0.467094
+v 0.468509 -0.478868 -0.468509
+v 0.468509 -0.468509 -0.478868
+v 0.478868 -0.468509 -0.468509
+v 0.468509 -0.478868 0.468509
+v 0.478868 -0.468509 0.468509
+v 0.468509 -0.468509 0.478868
+v -0.468509 -0.478868 0.468509
+v -0.468509 -0.468509 0.478868
+v -0.478868 -0.468509 0.468509
+v -0.468509 -0.478868 -0.468509
+v -0.478868 -0.468509 -0.468509
+v -0.468509 -0.468509 -0.478868
+v 0.468509 0.478868 -0.468509
+v 0.478868 0.468509 -0.468509
+v 0.468509 0.468509 -0.478868
+v 0.468509 0.478868 0.468510
+v 0.468509 0.468509 0.478869
+v 0.478868 0.468509 0.468510
+v -0.468509 0.478868 0.468509
+v -0.478868 0.468509 0.468509
+v -0.468509 0.468509 0.478868
+v -0.468509 0.478868 -0.468509
+v -0.468509 0.468509 -0.478868
+v -0.478868 0.468509 -0.468509
+vt 0.968509 0.978868
+vt 0.978868 0.968509
+vt 0.968509 0.968509
+vt 0.031491 0.031491
+vt 0.021132 0.031491
+vt 0.031491 0.021132
+vt 0.021132 0.968509
+vt 0.031491 0.978868
+vt 0.031491 0.968509
+vt 0.968509 0.021131
+vt 0.978868 0.031490
+vt 0.968509 0.031490
+vt 0.054997 0.945003
+vt 0.032906 0.945003
+vt 0.054997 0.967094
+vt 0.054997 0.032906
+vt 0.032906 0.054997
+vt 0.054997 0.054997
+vt 0.945003 0.054997
+vt 0.967094 0.054997
+vt 0.945003 0.032906
+vt 0.968509 0.031491
+vt 0.945003 0.967094
+vt 0.967094 0.945003
+vt 0.945003 0.945003
+vt 0.967093 0.945003
+vt 0.031490 0.968509
+vt 0.967093 0.054997
+vt 0.945003 0.967093
+vt 0.009150 0.054997
+vt 0.009150 0.945003
+vt 0.990849 0.945003
+vt 0.978868 0.031491
+vt 0.990850 0.054997
+vt 0.990850 0.945003
+vt 0.945003 0.009150
+vt 0.054997 0.009150
+vt 0.990849 0.054997
+vt 0.945003 0.990849
+vt 0.054997 0.990850
+vt 0.945003 0.990850
+vt 0.968509 0.021132
+vn 0.539140 -0.462966 -0.703513
+vn 0.703513 -0.539140 -0.462966
+vn 0.462966 -0.703513 -0.539140
+vn 0.703513 -0.462966 0.539140
+vn 0.462966 -0.539140 0.703513
+vn 0.539140 -0.703513 0.462966
+vn -0.539140 -0.462966 0.703513
+vn -0.703513 -0.539140 0.462966
+vn -0.462966 -0.703513 0.539140
+vn -0.703513 -0.462966 -0.539140
+vn -0.462966 -0.539140 -0.703513
+vn -0.539140 -0.703513 -0.462966
+vn 0.703513 0.462966 -0.539140
+vn 0.462966 0.539140 -0.703513
+vn 0.539140 0.703513 -0.462966
+vn 0.539140 0.462966 0.703513
+vn 0.703513 0.539140 0.462966
+vn 0.462966 0.703513 0.539140
+vn -0.703513 0.462966 0.539140
+vn -0.462966 0.539140 0.703513
+vn -0.539140 0.703513 0.462966
+vn -0.539140 0.462966 -0.703513
+vn -0.703513 0.539140 -0.462966
+vn -0.462966 0.703513 -0.539140
+vn -0.153356 0.232643 -0.960387
+vn -0.499557 0.182134 -0.846889
+vn -0.200720 0.575213 -0.792962
+vn -0.182134 -0.499557 -0.846889
+vn -0.575213 -0.200720 -0.792962
+vn -0.193823 -0.127750 -0.972655
+vn 0.153356 -0.232643 -0.960387
+vn 0.499557 -0.182134 -0.846889
+vn 0.200720 -0.575213 -0.792962
+vn 0.182134 0.499557 -0.846889
+vn 0.575213 0.200720 -0.792962
+vn 0.193823 0.127750 -0.972655
+vn -0.960387 -0.232643 -0.153356
+vn -0.846889 -0.182134 -0.499557
+vn -0.792962 -0.575213 -0.200720
+vn -0.846889 0.499557 -0.182134
+vn -0.792962 0.200720 -0.575213
+vn -0.972655 0.127750 -0.193823
+vn -0.960387 0.232643 0.153356
+vn -0.846889 0.182134 0.499557
+vn -0.792962 0.575213 0.200720
+vn -0.846889 -0.499557 0.182134
+vn -0.792962 -0.200720 0.575213
+vn -0.972655 -0.127750 0.193823
+vn -0.127750 -0.193823 0.972655
+vn -0.499557 -0.182134 0.846889
+vn -0.200720 -0.575213 0.792962
+vn -0.182134 0.499557 0.846889
+vn -0.575213 0.200720 0.792962
+vn -0.232643 0.153356 0.960387
+vn 0.127750 0.193823 0.972655
+vn 0.499557 0.182134 0.846889
+vn 0.200720 0.575213 0.792962
+vn 0.182134 -0.499557 0.846889
+vn 0.575213 -0.200720 0.792962
+vn 0.232643 -0.153356 0.960387
+vn 0.976165 -0.153356 0.153356
+vn 0.846889 -0.182134 0.499557
+vn 0.814112 -0.553423 0.175848
+vn 0.846889 0.499557 0.182134
+vn 0.792962 0.200720 0.575213
+vn 0.960387 0.153356 0.232643
+vn 0.972655 0.193823 -0.127750
+vn 0.846889 0.182134 -0.499557
+vn 0.792962 0.575213 -0.200720
+vn 0.825434 -0.520432 -0.218574
+vn 0.792962 -0.200720 -0.575213
+vn 0.961516 -0.194220 -0.194220
+vn 0.232643 0.960387 0.153356
+vn 0.182134 0.846889 0.499557
+vn 0.575213 0.792962 0.200720
+vn -0.499557 0.846889 0.182134
+vn -0.200720 0.792962 0.575213
+vn -0.127750 0.972655 0.193823
+vn -0.182134 0.846889 -0.499557
+vn -0.575213 0.792962 -0.200720
+vn -0.232643 0.960387 -0.153356
+vn 0.127750 0.972655 -0.193823
+vn 0.499557 0.846889 -0.182134
+vn 0.200720 0.792962 -0.575213
+vn -0.194220 -0.961516 -0.194220
+vn -0.520432 -0.825434 -0.218574
+vn -0.200720 -0.792962 -0.575213
+vn -0.553423 -0.814112 0.175848
+vn -0.153356 -0.976165 0.153356
+vn -0.182134 -0.846889 0.499557
+vn 0.499557 -0.846889 0.182134
+vn 0.200720 -0.792962 0.575213
+vn 0.153356 -0.960387 0.232643
+vn 0.193823 -0.972655 -0.127750
+vn 0.182134 -0.846889 -0.499557
+vn 0.575213 -0.792962 -0.200720
+usemtl Material
+s 1
+f 74/1/1 75/2/2 73/3/3
+f 77/4/4 78/5/5 76/6/6
+f 80/6/7 81/5/8 79/4/9
+f 83/7/10 84/8/11 82/9/12
+f 86/2/13 87/1/14 85/3/15
+f 89/10/16 90/11/17 88/12/18
+f 92/5/19 93/6/20 91/4/21
+f 95/8/22 96/7/23 94/9/24
+f 22/13/25 70/14/26 41/15/27
+f 70/14/26 95/9/22 41/15/27
+f 34/16/28 84/4/11 71/17/29
+f 34/16/28 71/17/29 21/18/30
+f 24/19/31 60/20/32 35/21/33
+f 60/20/32 74/22/1 35/21/33
+f 44/23/34 87/3/14 57/24/35
+f 44/23/34 57/24/35 23/25/36
+f 18/19/37 72/20/38 37/21/39
+f 72/20/38 83/22/10 37/21/39
+f 46/23/40 96/3/23 69/24/41
+f 46/23/40 69/24/41 17/25/42
+f 20/13/43 66/14/44 47/15/45
+f 66/14/44 92/9/19 47/15/45
+f 40/16/46 81/4/8 67/17/47
+f 40/16/46 67/17/47 19/18/48
+f 14/18/49 68/17/50 29/16/51
+f 68/17/50 80/4/7 29/16/51
+f 54/15/52 93/9/20 65/14/53
+f 54/15/52 65/14/53 13/13/54
+f 16/25/55 62/26/56 55/23/57
+f 62/26/56 89/3/16 55/23/57
+f 32/21/58 78/22/5 63/20/59
+f 32/21/58 63/20/59 15/19/60
+f 10/18/61 64/17/62 25/16/63
+f 64/17/62 77/4/4 25/16/63
+f 50/15/64 90/27/17 61/14/65
+f 50/15/64 61/14/65 9/13/66
+f 12/25/67 58/26/68 51/23/69
+f 58/26/68 86/3/13 51/23/69
+f 28/21/70 75/22/2 59/20/71
+f 28/21/70 59/20/71 11/19/72
+f 6/19/73 56/21/74 49/28/75
+f 56/21/74 88/12/18 49/28/75
+f 48/17/76 91/4/21 53/16/77
+f 48/17/76 53/16/77 5/18/78
+f 42/15/79 94/9/24 45/14/80
+f 42/15/79 45/14/80 8/13/81
+f 7/25/82 52/24/83 43/29/84
+f 52/24/83 85/3/15 43/29/84
+f 2/13/85 38/14/86 33/15/87
+f 38/14/86 82/9/12 33/15/87
+f 39/17/88 1/18/89 30/16/90
+f 39/17/88 30/16/90 79/4/9
+f 26/20/91 76/22/6 31/21/92
+f 26/20/91 31/21/92 4/19/93
+f 3/25/94 36/23/95 27/24/96
+f 36/23/95 73/3/3 27/24/96
+f 71/17/29 84/4/11 83/5/10
+f 71/17/29 83/5/10 72/30/38
+f 95/9/22 70/14/26 69/31/41
+f 95/9/22 69/31/41 96/7/23
+f 67/30/47 81/5/8 80/4/7
+f 67/30/47 80/4/7 68/17/50
+f 92/9/19 66/14/44 65/31/53
+f 92/9/19 65/31/53 93/7/20
+f 63/30/59 78/5/5 77/4/4
+f 63/30/59 77/4/4 64/17/62
+f 89/3/16 62/26/56 61/32/65
+f 89/3/16 61/32/65 90/2/17
+f 74/33/1 60/34/32 59/20/71
+f 74/33/1 59/20/71 75/22/2
+f 57/24/35 87/3/14 86/2/13
+f 57/24/35 86/2/13 58/35/68
+f 55/36/57 89/10/16 88/12/18
+f 55/36/57 88/12/18 56/21/74
+f 93/6/20 54/37/52 53/16/77
+f 93/6/20 53/16/77 91/4/21
+f 51/35/69 86/2/13 85/3/15
+f 51/35/69 85/3/15 52/24/83
+f 90/11/17 50/38/64 49/28/75
+f 90/11/17 49/28/75 88/12/18
+f 47/30/45 92/5/19 91/4/21
+f 47/30/45 91/4/21 48/17/76
+f 96/7/23 46/31/40 45/14/80
+f 96/7/23 45/14/80 94/9/24
+f 87/1/14 44/39/34 43/29/84
+f 87/1/14 43/29/84 85/3/15
+f 41/40/27 95/8/22 94/9/24
+f 41/40/27 94/9/24 42/15/79
+f 81/5/8 40/30/46 39/17/88
+f 81/5/8 39/17/88 79/4/9
+f 37/31/39 83/7/10 82/9/12
+f 37/31/39 82/9/12 38/14/86
+f 35/41/33 74/1/1 73/3/3
+f 35/41/33 73/3/3 36/23/95
+f 84/8/11 34/40/28 33/15/87
+f 84/8/11 33/15/87 82/9/12
+f 78/42/5 32/36/58 31/21/92
+f 78/42/5 31/21/92 76/22/6
+f 29/37/51 80/6/7 79/4/9
+f 29/37/51 79/4/9 30/16/90
+f 75/2/2 28/35/70 27/24/96
+f 75/2/2 27/24/96 73/3/3
+f 25/16/63 77/4/4 76/6/6
+f 25/16/63 76/6/6 26/37/91
+f 60/20/32 24/19/31 23/25/36
+f 60/20/32 23/25/36 57/24/35
+f 34/16/28 21/18/30 24/19/31
+f 34/16/28 24/19/31 35/21/33
+f 22/13/25 41/15/27 44/23/34
+f 22/13/25 44/23/34 23/25/36
+f 70/14/26 22/13/25 21/18/30
+f 70/14/26 21/18/30 71/17/29
+f 66/14/44 20/13/43 19/18/48
+f 66/14/44 19/18/48 67/17/47
+f 46/23/40 17/25/42 20/13/43
+f 46/23/40 20/13/43 47/15/45
+f 18/19/37 37/21/39 40/16/46
+f 18/19/37 40/16/46 19/18/48
+f 72/20/38 18/19/37 17/25/42
+f 72/20/38 17/25/42 69/24/41
+f 62/26/56 16/25/55 15/19/60
+f 62/26/56 15/19/60 63/20/59
+f 54/15/52 13/13/54 16/25/55
+f 54/15/52 16/25/55 55/23/57
+f 14/18/49 29/16/51 32/21/58
+f 14/18/49 32/21/58 15/19/60
+f 68/17/50 14/18/49 13/13/54
+f 68/17/50 13/13/54 65/14/53
+f 58/26/68 12/25/67 11/19/72
+f 58/26/68 11/19/72 59/20/71
+f 50/15/64 9/13/66 12/25/67
+f 50/15/64 12/25/67 51/23/69
+f 10/18/61 25/16/63 11/19/72
+f 25/16/63 28/21/70 11/19/72
+f 64/17/62 10/18/61 9/13/66
+f 64/17/62 9/13/66 61/14/65
+f 42/15/79 8/13/81 7/25/82
+f 42/15/79 7/25/82 43/29/84
+f 48/17/76 5/18/78 8/13/81
+f 48/17/76 8/13/81 45/14/80
+f 6/19/73 49/28/75 52/24/83
+f 6/19/73 52/24/83 7/25/82
+f 56/21/74 6/19/73 5/18/78
+f 56/21/74 5/18/78 53/16/77
+f 26/20/91 4/19/93 3/25/94
+f 26/20/91 3/25/94 27/24/96
+f 30/16/90 1/18/89 4/19/93
+f 30/16/90 4/19/93 31/21/92
+f 2/13/85 33/15/87 36/23/95
+f 2/13/85 36/23/95 3/25/94
+f 1/18/89 39/17/88 2/13/85
+f 39/17/88 38/14/86 2/13/85
+f 71/17/29 72/30/38 69/31/41
+f 71/17/29 69/31/41 70/14/26
+f 67/30/47 68/17/50 65/14/53
+f 67/30/47 65/14/53 66/31/44
+f 63/20/59 64/34/62 61/32/65
+f 63/20/59 61/32/65 62/26/56
+f 59/20/71 60/34/32 57/32/35
+f 59/20/71 57/32/35 58/26/68
+f 55/23/57 56/41/74 53/40/77
+f 55/23/57 53/40/77 54/15/52
+f 51/23/69 52/41/83 49/40/75
+f 51/23/69 49/40/75 50/15/64
+f 47/30/45 48/17/76 45/14/80
+f 47/30/45 45/14/80 46/31/40
+f 43/29/84 44/39/34 41/40/27
+f 43/29/84 41/40/27 42/15/79
+f 39/17/88 40/30/46 37/31/39
+f 39/17/88 37/31/39 38/14/86
+f 35/41/33 36/23/95 33/15/87
+f 35/41/33 33/15/87 34/40/28
+f 31/21/92 32/36/58 29/37/51
+f 31/21/92 29/37/51 30/16/90
+f 27/24/96 28/35/70 25/34/63
+f 27/24/96 25/34/63 26/20/91
+f 23/25/36 24/19/31 21/18/30
+f 23/25/36 21/18/30 22/13/25
+f 19/18/48 20/13/43 17/25/42
+f 19/18/48 17/25/42 18/19/37
+f 15/19/60 16/25/55 14/18/49
+f 16/25/55 13/13/54 14/18/49
+f 11/19/72 12/25/67 10/18/61
+f 12/25/67 9/13/66 10/18/61
+f 7/25/82 8/13/81 5/18/78
+f 7/25/82 5/18/78 6/19/73
+f 1/18/89 2/13/85 3/25/94
+f 1/18/89 3/25/94 4/19/93
diff --git a/src/GLX.hs b/src/GLX.hs
index 9ad6392..8dbca6a 100644
--- a/src/GLX.hs
+++ b/src/GLX.hs
@@ -11,7 +11,7 @@ import Data.Maybe (isJust)
import Data.Ratio
import Graphics.Rendering.OpenGL.GL (($=), GLdouble, GLfloat, Vector3(..), Capability(..))
-import Graphics.Rendering.OpenGL.GL.CoordTrans (matrixMode, MatrixMode(..), viewport, Position(..), Size(..), loadIdentity, ortho, translate, scale, rotate)
+import Graphics.Rendering.OpenGL.GL.CoordTrans (matrixMode, MatrixMode(..), viewport, Position(..), Size(..), loadIdentity, ortho, translate, scale, rotate, frustum)
import Graphics.X11.Types
import Graphics.X11.Xlib.Atom (internAtom)
@@ -205,10 +205,11 @@ resize lw lh w h = do
matrixMode $= Projection
loadIdentity
- ortho (-sf*aspectf) (sf*aspectf) (-sf) sf (-1) 1
- scale 1 1 (0.1 :: GLfloat)
+ --ortho (-sf*aspectf) (sf*aspectf) (-sf) sf (-1) 1
+ --scale 1 1 (0.1 :: GLfloat)
+ frustum (-sf*aspectf) (sf*aspectf) (-sf) sf 10 100
rotate (-30) $ Vector3 1 0 (0 :: GLfloat)
- translate $ Vector3 (-(fromIntegral lw)/2) (-(fromIntegral lh)/2) (0 :: GLfloat)
+ translate $ Vector3 (-(fromIntegral lw)/2) ((fromIntegral lh)/2) (-11 :: GLfloat)
matrixMode $= Modelview 0
diff --git a/src/HTanks.hs b/src/HTanks.hs
index 82338a4..2fd2148 100644
--- a/src/HTanks.hs
+++ b/src/HTanks.hs
@@ -33,12 +33,14 @@ main = do
when (initialized gl) $ do
currentTime <- getCurrentTime
- let gamestate = GameState {level = theLevel, tanks = [ Tank 5.0 5.0 0 0 1.5 270 False 3 1 5 1
- , Tank 5.0 3.5 0 0 1.5 270 False 3 1 5 1
+ let gamestate = GameState {level = theLevel, tanks = [ Tank 7.0 4.0 0 0 1.5 270 False 3 1 5 1
+ , Tank 4.0 4.0 0 0 1.5 270 False 3 1 5 1
+ , Tank 10.0 4.0 0 0 1.5 270 False 3 1 5 1
], bullets = []}
mainstate = MainState {run = True, driver = SomeDriver gl, time = currentTime, players =
[ SomePlayer humanPlayer
- , SomePlayer $ CPUPlayer 0
+ , SomePlayer $ CPUPlayer (-90)
+ , SomePlayer $ CPUPlayer 90
], textures = M.empty, models = M.empty, gameState = gamestate}
runMain mainstate $ do
diff --git a/src/Model.hs b/src/Model.hs
index 0c273e9..e2c045a 100644
--- a/src/Model.hs
+++ b/src/Model.hs
@@ -6,10 +6,12 @@ module Model ( Model(..)
import Paths_htanks
import Data.Obj3D.GL (InterleavedObj)
-data Model = ModelTank
+data Model = ModelTank | ModelBullet | ModelBlock
deriving (Eq, Ord, Show)
modelPath :: Model -> IO FilePath
modelPath t = getDataFileName $ "model/" ++ (name t) ++ ".obj"
where
name ModelTank = "tank"
+ name ModelBullet = "bullet"
+ name ModelBlock = "cube"
diff --git a/src/Render.hs b/src/Render.hs
index 91146ba..aa084d8 100644
--- a/src/Render.hs
+++ b/src/Render.hs
@@ -80,7 +80,7 @@ setup = do
shadeModel $= Smooth
lighting $= Enabled
light (Light 0) $= Enabled
- position (Light 0) $= Vertex4 (-1) (-1) 1 (0 :: GLfloat)
+ position (Light 0) $= Vertex4 (-1) (-1) 1.5 (0 :: GLfloat)
colorMaterial $= Just (Front, AmbientAndDiffuse)
clientState VertexArray $= Enabled
@@ -96,6 +96,8 @@ setup = do
getTexture TextureCrosshair
getModel ModelTank
+ getModel ModelBullet
+ getModel ModelBlock
return ()
@@ -113,6 +115,8 @@ render = do
textureCrosshair <- getTexture TextureCrosshair
modelTank <- getModel ModelTank
+ modelBullet <- getModel ModelBullet
+ modelBlock <- getModel ModelBlock
(lw, lh) <- gets (level . gameState) >>= \l -> return (fromIntegral . levelWidth $ l :: GLfloat, fromIntegral . levelHeight $ l :: GLfloat)
@@ -127,17 +131,17 @@ render = do
normal $ Normal3 0 0 (1 :: GLfloat)
unsafeRenderPrimitive Quads $ do
- texCoord $ TexCoord2 (0 :: GLfloat) (0 :: GLfloat)
- vertex $ Vertex2 0 lh
+ texCoord $ TexCoord2 (-0.5 :: GLfloat) (-0.5 :: GLfloat)
+ vertex $ Vertex2 (-1) (lh+1)
- texCoord $ TexCoord2 (lw/2) 0
- vertex $ Vertex2 lw lh
+ texCoord $ TexCoord2 (lw/2+0.5) (-0.5)
+ vertex $ Vertex2 (lw+1) (lh+1)
- texCoord $ TexCoord2 (lw/2) (lh/2)
- vertex $ Vertex2 lw 0
+ texCoord $ TexCoord2 (lw/2+0.5) (lh/2+0.5)
+ vertex $ Vertex2 (lw+1) (-1)
- texCoord $ TexCoord2 0 (lh/2)
- vertex $ Vertex2 (0 :: GLfloat) (0 :: GLfloat)
+ texCoord $ TexCoord2 (-0.5) (lh/2+0.5)
+ vertex $ Vertex2 (-1 :: GLfloat) (-1 :: GLfloat)
bindInterleavedArrays modelTank
@@ -163,30 +167,44 @@ render = do
unsafePreservingMatrix $ do
rotate 90 $ Vector3 1 0 (0 :: GLfloat)
drawObject modelTank 0
+
+ texture Texture2D $= Disabled
+ bindInterleavedArrays modelBullet
forM_ bulletlist $ \bullet -> unsafePreservingMatrix $ do
- let x = realToFrac . bulletX $ bullet
- y = realToFrac . bulletY $ bullet
- rotDir = realToFrac . bulletDir $ bullet
-
- translate $ Vector3 x y (0.2 :: GLfloat)
- rotate 30 $ Vector3 1 0 (0 :: GLfloat)
- rotate rotDir $ Vector3 0 0 (1 :: GLfloat)
+ let x = realToFrac . bulletX $ bullet
+ y = realToFrac . bulletY $ bullet
+ rotDir = realToFrac . bulletDir $ bullet
- textureBinding Texture2D $= Just textureBullet
+ translate $ Vector3 x y (0.25 :: GLfloat)
+ rotate (rotDir-90) $ Vector3 0 0 (1 :: GLfloat)
- unsafeRenderPrimitive Quads $ do
- texCoord $ TexCoord2 (0 :: GLfloat) (0 :: GLfloat)
- vertex $ Vertex3 (-0.1 :: GLfloat) (-0.1 :: GLfloat) 0
-
- texCoord $ TexCoord2 (0 :: GLfloat) (1 :: GLfloat)
- vertex $ Vertex3 (-0.1 :: GLfloat) (0.1 :: GLfloat) 0
-
- texCoord $ TexCoord2 (1 :: GLfloat) (1 :: GLfloat)
- vertex $ Vertex3 (0.1 :: GLfloat) (0.1 :: GLfloat) 0
-
- texCoord $ TexCoord2 (1 :: GLfloat) (0 :: GLfloat)
- vertex $ Vertex3 (0.1 :: GLfloat) (-0.1 :: GLfloat) 0
+ unsafePreservingMatrix $ do
+ drawObject modelBullet 0
+
+ bindInterleavedArrays modelBlock
+
+ texture Texture2D $= Enabled
+ textureBinding Texture2D $= Just textureWood
+ forM_ [0.5..13.5] $ \x -> unsafePreservingMatrix $ do
+ translate $ Vector3 x 8.5 (0.5 :: GLfloat)
+ rotate 90 $ Vector3 1 0 (0 :: GLfloat)
+ drawObject modelBlock 0
+
+ forM_ [0.5..13.5] $ \x -> unsafePreservingMatrix $ do
+ translate $ Vector3 x (-0.5) (0.5 :: GLfloat)
+ rotate 90 $ Vector3 1 0 (0 :: GLfloat)
+ drawObject modelBlock 0
+
+ forM_ [-0.5..8.5] $ \y -> unsafePreservingMatrix $ do
+ translate $ Vector3 (-0.5) y (0.5 :: GLfloat)
+ rotate 90 $ Vector3 1 0 (0 :: GLfloat)
+ drawObject modelBlock 0
+
+ forM_ [-0.5..8.5] $ \y -> unsafePreservingMatrix $ do
+ translate $ Vector3 14.5 y (0.5 :: GLfloat)
+ rotate 90 $ Vector3 1 0 (0 :: GLfloat)
+ drawObject modelBlock 0
depthFunc $= Just Always