diff --git a/.gitignore b/.gitignore
new file mode 100644
index 00000000..5171c540
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+node_modules
+npm-debug.log
\ No newline at end of file
diff --git a/README.md b/README.md
index fad423fa..a73a4f90 100644
--- a/README.md
+++ b/README.md
@@ -1,45 +1,91 @@
-
+
# Project 4: Shape Grammar
-For this assignment you'll be building directly off of Project 3. To make things easier to keep track of, please fork and clone this repository [https://github.com/CIS700-Procedural-Graphics/Project4-Shape-Grammar](https://github.com/CIS700-Procedural-Graphics/Project4-Shape-Grammar) and copy your Project 3 code to start.
+I built a suburban neighborhood. The final product can be found at https://tabathah.github.io/Project4-Shape-Grammar.
+The following as an overview of how I completed this projet. Some pictures of the final product from above and from a side view are here:
+
+
+
+
+
+**Creating the Homes**
+
+Each of the homes in this neighborhood was procedurally generated using a shape grammar. I started with one initial shape and that shape was subdivided or rotated based on random probability in order to get a fairly realistic looking suburban home.
+
+The shapes were represented by a Shape class that had the following information: a character symbol representing what time of shape it was so that following transformations and rendering of the shape would be done properly, the position, rotation, and scale of the shape, used to create the mesh that appears on screen, the material of the shape so that through each of the iterations of the shapes changing they would all remain the same colors, vectors representing the local x and z axes of the shape so that when new positions were calculated, they would be moved in relation to the shapes current orientation, and finally a boolean representing whether this shape should have a door.
+
+My initial shape was a simple house shape with a rectangular box and triangular prism on top, which I created in Maya and imported as an OBJ file. The initial OBJ is depicted below:
+
+
+
+I wrote shaders for the texturing of the houses. One of two roof colors and one of three wall colors was randomly chosen and sent into the shader. In the fragment shader, the normal at that point was checked for a non-zero y-component. If the y was non-zero, it had to be a part of the roof so it was colored with the input roof color, otherwise it was part of a wall so it was colored with the input wall color. Here is the result:
+
+
+
+At the first iteration of executing the grammar, the house always subdivides along its z axis in half. Then one of three configurations can happen with some probability. In the first possible configuration, the front half of house resulting from the subdivision is scaled down by half in the z direction and moved to either the left or right side of the house. In the second configuration, the front half from the subdivision is discarded and two house shapes of depth equal to half the back half from the subdivision's width are rotated 90 degrees and placed in the front of the house. In the third and final configuration, a similar operation is done as the second configuration, except three house shapes of depth equal to a third of the back half's width are placced in the front of the house. Here are pictures of the first, second, and third configurations, respectively:
+
+
+
+
+
+
+
+At the second iteration of executing the grammar, the shapes are slightly modified and detail additions are made. In the case of the first configuration, another scaled down shape is added to the inner side of the front shape, as depicted below:
+
+
+
+In the case of the second and third conifgurations, the rotated shapes in the front are modified in the following way. Either the shape is deleted entirely, unchanged, its height is scaled by 1.25, or its height is scaled by 1.5. Here is a picture of a house with fronts of all diferrent heights.
+
+
+
+Finally, at the second iteration, I modified the back half of the houses, which was in all three configurations. Firstly, with some probability I had the height scale up by 1.5. This is the first picture below. Secondly, I added a chimney to either the right or left side of the back of the house. I shaded this chimney with the same shader on the house. A chminey is shown in the second picture below:
+
+
+
+
+
+For both the height modification of the back half and the rotated fron house shapes, I increased the probability of the height scaling up in relation to the z coordinate of the shapes position. This way, on one side of the nieghborhood the houses tend to be taller than on the other side, formins some sort of class division if you will.
+
+One last extra detail was the doors. If the house went into the first configuration at the first iteration, the door ended up on the inner house shape that gets added in the second iteration. If the house went into one of the other two configurations, one of the two or three front rotated shapes was randomly chosen to have a door on it. If that shape was not detroyed in the second iteration, the door was placed in the front of it, otherwise it was placed on the back half of the house. Two examples of doors are shown below:
+
+
+
+
+
+**Forming the Neighborhood Layout**
+
+I first started with two straight main streets on either side of my neighborhood, shaded grey:
+
+
+
+I then created the roads that my houses would be situated on. I created 5 three.js CatmullRom curves by making points out of equally spaced x values and z values that had some random offset between -6 and 6. I then added road squares to points on the curve to display the curves.
+
+
+
+Now it was time to add houses onto the roads. At evenly spaced points on the curve I put homes and rotated them so they would be parallel to the tangent of the curve at that point. I also offset them a bit away from the curve in the z direction so they would be next to the road rather than on it.
+
+Here is a picture of houses on one side of the road:
+
+
+
+And here is a picture of houses on both sides (the houses were rotated so that they would be facing the road):
+
+
-**Goal:** to model an urban environment using a shape grammar.
+**Adding Details**
-**Note:** We’re well aware that a nice-looking procedural city is a lot of work for a single week. Focus on designing a nice building grammar. The city layout strategies outlined in class (the extended l-systems) are complex and not expected. We will be satisfied with something reasonably simple, just not a uniform grid!
+The first detail I added was driveways. I simply added a road square in the same positions where houses were added, offset from the road slightly less than the houses were to create a semblance of a driveway.
-## Symbol Node (5 points)
-Modify your symbol node class to include attributes necessary for rendering, such as
-- Associated geometry instance
-- Position
-- Scale
-- Anything else you may need
+
-## Grammar design (55 points)
-- Design at least five shape grammar rules for producing procedural buildings. Your buildings should vary in geometry and decorative features (beyond just differently-scaled cubes!). At least some of your rules should create child geometry that is in some way dependent on its parent’s state. (20 points)
- - Eg. A building may be subdivided along the x, y, or z axis into two smaller buildings
- - Some of your rules must be designed to use some property about its location. (10 points)
- - Your grammar should have some element of variation so your buildings are non-deterministic. Eg. your buildings sometimes subdivide along the x axis, and sometimes the y. (10 points)
-- Write a renderer that will interpret the results of your shape grammar parser and adds the appropriate geometry to your scene for each symbol in your set. (10 points)
+Next I decided to make trees. Again I created my own model in Maya and imported it as an OBJ. I shaded them the same way I shaded houses, as again any normals with non-zero y-components corresponded to leaves and the others were part of the trunk. I wanted the trees to populate the empty space between the roads my houses were on. To do this, I found the difference between the z coordinates of points on two consecutive roads and added trees in the space where they wouldnt overlap the houses or roads. At every point where a tree could be placed I added it with a 50% chance. I also offset them in the x and z randomly to give the semblance of realistic tree populating. The result was the following:
-## Create a city (30 points)
-- Add a ground plane or some other base terrain to your scene (0 points, come on now)
-- Using any strategy you’d like, procedurally generate features that demarcate your city into different areas in an interesting and plausible way (Just a uniform grid is neither interesting nor plausible). (20 points)
- - Suggestions: roads, rivers, lakes, parks, high-population density
- - Note, these features don’t have to be directly visible, like high-population density, but they should somehow be visible in the appearance or arrangement of your buildings. Eg. High population density is more likely to generate taller buildings
-- Generate buildings throughout your city, using information about your city’s features. Color your buildings with a method that uses some aspect of its state. Eg. Color buildings by height, by population density, by number of rules used to generate it. (5 points)
-- Document your grammar rules and general approach in the readme. (5 points)
-- ???
-- Profit.
+
-## Make it interesting (10)
-Experiment! Make your city a work of art.
+
+
+The last detail I added was lamp posts. I created my own, very crude geometry in Maya. I added them on either side of both the main side roads and the roads the houses resided on. A closeup is depicted here:
+
-## Warnings:
-You can very easily blow up three.js with this assignment. With a very simple grammar, our medium quality machine was able to handle 100 buildings with 6 generations each, but be careful if you’re doing this all CPU-side.
-## Suggestions for the overachievers:
-Go for a very high level of decorative detail!
-Place buildings with a strategy such that buildings have doors and windows that are always accessible.
-Generate buildings with coherent interiors
-If dividing your city into lots, generate odd-shaped lots and create building meshes that match their shape ie. rather than working with cubes, extrude upwards from the building footprints you find to generate a starting mesh to subdivide rather than starting with platonic geometry.
diff --git a/Sky-Blue-Sky.jpg b/Sky-Blue-Sky.jpg
new file mode 100644
index 00000000..9ffe27c1
Binary files /dev/null and b/Sky-Blue-Sky.jpg differ
diff --git a/deploy.js b/deploy.js
new file mode 100644
index 00000000..9defe7c3
--- /dev/null
+++ b/deploy.js
@@ -0,0 +1,38 @@
+var colors = require('colors');
+var path = require('path');
+var git = require('simple-git')(__dirname);
+var deploy = require('gh-pages-deploy');
+var packageJSON = require('require-module')('./package.json');
+
+var success = 1;
+git.fetch('origin', 'master', function(err) {
+ if (err) throw err;
+ git.status(function(err, status) {
+ if (err) throw err;
+ if (!status.isClean()) {
+ success = 0;
+ console.error('Error: You have uncommitted changes! Please commit them first'.red);
+ }
+
+ if (status.current !== 'master') {
+ success = 0;
+ console.warn('Warning: Please deploy from the master branch!'.yellow)
+ }
+
+ git.diffSummary(['origin/master'], function(err, diff) {
+ if (err) throw err;
+
+ if (diff.files.length || diff.insertions || diff.deletions) {
+ success = 0;
+ console.error('Error: Current branch is different from origin/master! Please push all changes first'.red)
+ }
+
+ if (success) {
+ var cfg = packageJSON['gh-pages-deploy'] || {};
+ var buildCmd = deploy.getFullCmd(cfg);
+ deploy.displayCmds(deploy.getFullCmd(cfg));
+ deploy.execBuild(buildCmd, cfg);
+ }
+ })
+ })
+})
\ No newline at end of file
diff --git a/house.mb b/house.mb
new file mode 100644
index 00000000..584cf2d9
Binary files /dev/null and b/house.mb differ
diff --git a/house.mtl b/house.mtl
new file mode 100644
index 00000000..c89145d9
--- /dev/null
+++ b/house.mtl
@@ -0,0 +1,6 @@
+newmtl initialShadingGroup
+illum 4
+Kd 0.50 0.50 0.50
+Ka 0.00 0.00 0.00
+Tf 1.00 1.00 1.00
+Ni 1.00
diff --git a/house.obj b/house.obj
new file mode 100644
index 00000000..c32c0899
--- /dev/null
+++ b/house.obj
@@ -0,0 +1,111 @@
+# This file uses centimeters as units for non-parametric coordinates.
+
+mtllib house.mtl
+g default
+v -1.351567 1.002031 2.587286
+v 1.351567 1.002031 2.587286
+v -0.126426 1.983041 1.975369
+v 0.126426 1.983041 1.975369
+v -0.126426 1.983041 -1.975369
+v 0.126426 1.983041 -1.975369
+v -1.351567 1.002031 -2.587286
+v 1.351567 1.002031 -2.587286
+v -1.208793 -1.024707 2.339137
+v 1.208793 -1.024707 2.339137
+v -1.208793 1.024707 2.339137
+v 1.208793 1.024707 2.339137
+v -1.208793 1.024707 -2.339137
+v 1.208793 1.024707 -2.339137
+v -1.208793 -1.024707 -2.339137
+v 1.208793 -1.024707 -2.339137
+vt 0.375000 0.000000
+vt 0.625000 0.000000
+vt 0.375000 0.250000
+vt 0.625000 0.250000
+vt 0.375000 0.500000
+vt 0.625000 0.500000
+vt 0.375000 0.750000
+vt 0.625000 0.750000
+vt 0.375000 1.000000
+vt 0.625000 1.000000
+vt 0.875000 0.000000
+vt 0.875000 0.250000
+vt 0.125000 0.000000
+vt 0.125000 0.250000
+vt 0.375000 0.000000
+vt 0.625000 0.000000
+vt 0.625000 0.250000
+vt 0.375000 0.250000
+vt 0.625000 0.500000
+vt 0.375000 0.500000
+vt 0.625000 0.750000
+vt 0.375000 0.750000
+vt 0.625000 1.000000
+vt 0.375000 1.000000
+vt 0.875000 0.000000
+vt 0.875000 0.250000
+vt 0.125000 0.000000
+vt 0.125000 0.250000
+vn 0.000000 0.529244 0.848470
+vn 0.000000 0.529244 0.848470
+vn 0.000000 0.529244 0.848470
+vn 0.000000 0.529244 0.848470
+vn 0.000000 1.000000 0.000000
+vn 0.000000 1.000000 0.000000
+vn 0.000000 1.000000 0.000000
+vn 0.000000 1.000000 0.000000
+vn 0.000000 0.529244 -0.848470
+vn 0.000000 0.529244 -0.848470
+vn 0.000000 0.529244 -0.848470
+vn 0.000000 0.529244 -0.848470
+vn 0.000000 -1.000000 0.000000
+vn 0.000000 -1.000000 0.000000
+vn 0.000000 -1.000000 0.000000
+vn 0.000000 -1.000000 0.000000
+vn 0.625043 0.780590 0.000000
+vn 0.625043 0.780590 0.000000
+vn 0.625043 0.780590 0.000000
+vn 0.625043 0.780590 0.000000
+vn -0.625043 0.780590 0.000000
+vn -0.625043 0.780590 0.000000
+vn -0.625043 0.780590 0.000000
+vn -0.625043 0.780590 0.000000
+vn 0.000000 0.000000 1.000000
+vn 0.000000 0.000000 1.000000
+vn 0.000000 0.000000 1.000000
+vn 0.000000 0.000000 1.000000
+vn 0.000000 1.000000 0.000000
+vn 0.000000 1.000000 0.000000
+vn 0.000000 1.000000 0.000000
+vn 0.000000 1.000000 0.000000
+vn 0.000000 0.000000 -1.000000
+vn 0.000000 0.000000 -1.000000
+vn 0.000000 0.000000 -1.000000
+vn 0.000000 0.000000 -1.000000
+vn 0.000000 -1.000000 0.000000
+vn 0.000000 -1.000000 0.000000
+vn 0.000000 -1.000000 0.000000
+vn 0.000000 -1.000000 0.000000
+vn 1.000000 0.000000 0.000000
+vn 1.000000 0.000000 0.000000
+vn 1.000000 0.000000 0.000000
+vn 1.000000 0.000000 0.000000
+vn -1.000000 0.000000 0.000000
+vn -1.000000 0.000000 0.000000
+vn -1.000000 0.000000 0.000000
+vn -1.000000 0.000000 0.000000
+s off
+g pCube3
+usemtl initialShadingGroup
+f 1/1/1 2/2/2 4/4/3 3/3/4
+f 3/3/5 4/4/6 6/6/7 5/5/8
+f 5/5/9 6/6/10 8/8/11 7/7/12
+f 7/7/13 8/8/14 2/10/15 1/9/16
+f 2/2/17 8/11/18 6/12/19 4/4/20
+f 7/13/21 1/1/22 3/3/23 5/14/24
+f 9/15/25 10/16/26 12/17/27 11/18/28
+f 11/18/29 12/17/30 14/19/31 13/20/32
+f 13/20/33 14/19/34 16/21/35 15/22/36
+f 15/22/37 16/21/38 10/23/39 9/24/40
+f 10/16/41 16/25/42 14/26/43 12/17/44
+f 15/27/45 9/15/46 11/18/47 13/28/48
diff --git a/index.html b/index.html
new file mode 100644
index 00000000..e609adf4
--- /dev/null
+++ b/index.html
@@ -0,0 +1,19 @@
+
+
+
+ HW2: LSystems
+
+
+
+
+
+
diff --git a/lamppost.mb b/lamppost.mb
new file mode 100644
index 00000000..fef11f3b
Binary files /dev/null and b/lamppost.mb differ
diff --git a/lamppost.mtl b/lamppost.mtl
new file mode 100644
index 00000000..c89145d9
--- /dev/null
+++ b/lamppost.mtl
@@ -0,0 +1,6 @@
+newmtl initialShadingGroup
+illum 4
+Kd 0.50 0.50 0.50
+Ka 0.00 0.00 0.00
+Tf 1.00 1.00 1.00
+Ni 1.00
diff --git a/lamppost.obj b/lamppost.obj
new file mode 100644
index 00000000..fa907244
--- /dev/null
+++ b/lamppost.obj
@@ -0,0 +1,929 @@
+# This file uses centimeters as units for non-parametric coordinates.
+
+mtllib lamppost.mtl
+g default
+v 0.103531 2.403354 0.278780
+v 0.039545 2.402598 0.213110
+v -0.039545 2.402598 0.213110
+v -0.103531 2.403354 0.278780
+v -0.127972 2.403890 0.385035
+v -0.103531 2.403354 0.491290
+v -0.039545 2.402598 0.556959
+v 0.039545 2.402598 0.556959
+v 0.103531 2.403354 0.491290
+v 0.127971 2.403890 0.385035
+v 0.196928 2.435130 0.182925
+v 0.075220 2.434321 0.058015
+v -0.075220 2.434321 0.058015
+v -0.196928 2.435130 0.182926
+v -0.243416 2.436408 0.385035
+v -0.196928 2.435130 0.587144
+v -0.075220 2.434321 0.712054
+v 0.075220 2.434321 0.712054
+v 0.196928 2.435130 0.587144
+v 0.243416 2.436408 0.385035
+v 0.271048 2.486756 0.106855
+v 0.103531 2.486756 -0.065069
+v -0.103531 2.486756 -0.065069
+v -0.271048 2.486756 0.106855
+v -0.335034 2.488088 0.385035
+v -0.271048 2.486756 0.663214
+v -0.103531 2.486756 0.835138
+v 0.103531 2.486756 0.835138
+v 0.271048 2.486756 0.663214
+v 0.335034 2.488088 0.385035
+v 0.318636 2.552829 0.058015
+v 0.121708 2.552829 -0.144094
+v -0.121708 2.552829 -0.144094
+v -0.318636 2.552829 0.058015
+v -0.393856 2.554319 0.385035
+v -0.318636 2.552829 0.712054
+v -0.121708 2.552829 0.914163
+v 0.121708 2.552829 0.914163
+v 0.318636 2.552829 0.712054
+v 0.393856 2.554319 0.385035
+v 0.335034 2.626161 0.041186
+v 0.127971 2.626070 -0.171324
+v -0.127972 2.626070 -0.171324
+v -0.335034 2.626161 0.041186
+v -0.414124 2.629565 0.385035
+v -0.335034 2.626161 0.728883
+v -0.127971 2.626070 0.941393
+v 0.127972 2.626070 0.941393
+v 0.335034 2.626161 0.728883
+v 0.414124 2.629565 0.385035
+v 0.318636 2.702063 0.058015
+v 0.121708 2.699312 -0.144094
+v -0.121708 2.699312 -0.144094
+v -0.318636 2.702063 0.058015
+v -0.393856 2.709499 0.385035
+v -0.318636 2.702063 0.712054
+v -0.121708 2.699312 0.914163
+v 0.121708 2.699312 0.914163
+v 0.318636 2.702063 0.712054
+v 0.393856 2.709499 0.385035
+v 0.271048 2.780191 0.106855
+v 0.103531 2.769402 -0.065069
+v -0.103531 2.769402 -0.065069
+v -0.271048 2.780191 0.106855
+v -0.335034 2.791172 0.385035
+v -0.271048 2.780191 0.663214
+v -0.103531 2.769402 0.835138
+v 0.103531 2.769402 0.835138
+v 0.271048 2.780191 0.663214
+v 0.335034 2.791172 0.385035
+v 0.196928 2.859207 0.182925
+v 0.075220 2.846056 0.058015
+v -0.075220 2.846056 0.058015
+v -0.196928 2.859207 0.182926
+v -0.243416 2.868977 0.385035
+v -0.196928 2.859207 0.587144
+v -0.075220 2.846056 0.712054
+v 0.075220 2.846056 0.712054
+v 0.196928 2.859207 0.587144
+v 0.243416 2.868977 0.385035
+v 0.103531 2.925344 0.278780
+v 0.039545 2.919572 0.213110
+v -0.039545 2.919572 0.213110
+v -0.103531 2.925344 0.278780
+v -0.127972 2.929067 0.385035
+v -0.103531 2.925344 0.491290
+v -0.039545 2.919572 0.556959
+v 0.039545 2.919572 0.556959
+v 0.103531 2.925344 0.491290
+v 0.127971 2.929067 0.385035
+v 0.000000 2.392867 0.385035
+v 0.000000 2.952294 0.385035
+v 0.315258 -2.707324 -0.229048
+v 0.120418 -2.707324 -0.370608
+v -0.120418 -2.707324 -0.370608
+v -0.315258 -2.707324 -0.229048
+v -0.389681 -2.707324 0.000000
+v -0.315258 -2.707324 0.229048
+v -0.120418 -2.707324 0.370608
+v 0.120418 -2.707324 0.370608
+v 0.315258 -2.707324 0.229048
+v 0.389681 -2.707324 0.000000
+v 0.118746 2.707324 -0.086274
+v 0.045357 2.707324 -0.139594
+v -0.045357 2.707324 -0.139594
+v -0.118746 2.707324 -0.086274
+v -0.146778 2.707324 0.000000
+v -0.118746 2.707324 0.086274
+v -0.045357 2.707324 0.139594
+v 0.045357 2.707324 0.139594
+v 0.118746 2.707324 0.086274
+v 0.146778 2.707324 0.000000
+v 0.000000 -2.707324 0.000000
+v 0.000000 2.707324 0.000000
+v 0.146778 -1.891834 0.000000
+v 0.118746 -1.891834 0.086274
+v 0.045357 -1.891834 0.139594
+v -0.045357 -1.891834 0.139594
+v -0.118746 -1.891834 0.086274
+v -0.146778 -1.891834 0.000000
+v -0.118746 -1.891834 -0.086274
+v -0.045357 -1.891834 -0.139594
+v 0.045357 -1.891834 -0.139594
+v 0.118746 -1.891834 -0.086274
+vt 0.000000 0.100000
+vt 0.100000 0.100000
+vt 0.200000 0.100000
+vt 0.300000 0.100000
+vt 0.400000 0.100000
+vt 0.500000 0.100000
+vt 0.600000 0.100000
+vt 0.700000 0.100000
+vt 0.800000 0.100000
+vt 0.900000 0.100000
+vt 1.000000 0.100000
+vt 0.000000 0.200000
+vt 0.100000 0.200000
+vt 0.200000 0.200000
+vt 0.300000 0.200000
+vt 0.400000 0.200000
+vt 0.500000 0.200000
+vt 0.600000 0.200000
+vt 0.700000 0.200000
+vt 0.800000 0.200000
+vt 0.900000 0.200000
+vt 1.000000 0.200000
+vt 0.000000 0.300000
+vt 0.100000 0.300000
+vt 0.200000 0.300000
+vt 0.300000 0.300000
+vt 0.400000 0.300000
+vt 0.500000 0.300000
+vt 0.600000 0.300000
+vt 0.700000 0.300000
+vt 0.800000 0.300000
+vt 0.900000 0.300000
+vt 1.000000 0.300000
+vt 0.000000 0.400000
+vt 0.100000 0.400000
+vt 0.200000 0.400000
+vt 0.300000 0.400000
+vt 0.400000 0.400000
+vt 0.500000 0.400000
+vt 0.600000 0.400000
+vt 0.700000 0.400000
+vt 0.800000 0.400000
+vt 0.900000 0.400000
+vt 1.000000 0.400000
+vt 0.000000 0.500000
+vt 0.100000 0.500000
+vt 0.200000 0.500000
+vt 0.300000 0.500000
+vt 0.400000 0.500000
+vt 0.500000 0.500000
+vt 0.600000 0.500000
+vt 0.700000 0.500000
+vt 0.800000 0.500000
+vt 0.900000 0.500000
+vt 1.000000 0.500000
+vt 0.000000 0.600000
+vt 0.100000 0.600000
+vt 0.200000 0.600000
+vt 0.300000 0.600000
+vt 0.400000 0.600000
+vt 0.500000 0.600000
+vt 0.600000 0.600000
+vt 0.700000 0.600000
+vt 0.800000 0.600000
+vt 0.900000 0.600000
+vt 1.000000 0.600000
+vt 0.000000 0.700000
+vt 0.100000 0.700000
+vt 0.200000 0.700000
+vt 0.300000 0.700000
+vt 0.400000 0.700000
+vt 0.500000 0.700000
+vt 0.600000 0.700000
+vt 0.700000 0.700000
+vt 0.800000 0.700000
+vt 0.900000 0.700000
+vt 1.000000 0.700000
+vt 0.000000 0.800000
+vt 0.100000 0.800000
+vt 0.200000 0.800000
+vt 0.300000 0.800000
+vt 0.400000 0.800000
+vt 0.500000 0.800000
+vt 0.600000 0.800000
+vt 0.700000 0.800000
+vt 0.800000 0.800000
+vt 0.900000 0.800000
+vt 1.000000 0.800000
+vt 0.000000 0.900000
+vt 0.100000 0.900000
+vt 0.200000 0.900000
+vt 0.300000 0.900000
+vt 0.400000 0.900000
+vt 0.500000 0.900000
+vt 0.600000 0.900000
+vt 0.700000 0.900000
+vt 0.800000 0.900000
+vt 0.900000 0.900000
+vt 1.000000 0.900000
+vt 0.050000 0.000000
+vt 0.150000 0.000000
+vt 0.250000 0.000000
+vt 0.350000 0.000000
+vt 0.450000 0.000000
+vt 0.550000 0.000000
+vt 0.650000 0.000000
+vt 0.750000 0.000000
+vt 0.850000 0.000000
+vt 0.950000 0.000000
+vt 0.050000 1.000000
+vt 0.150000 1.000000
+vt 0.250000 1.000000
+vt 0.350000 1.000000
+vt 0.450000 1.000000
+vt 0.550000 1.000000
+vt 0.650000 1.000000
+vt 0.750000 1.000000
+vt 0.850000 1.000000
+vt 0.950000 1.000000
+vt 0.375000 0.312500
+vt 0.400000 0.312500
+vt 0.400000 0.381401
+vt 0.375000 0.381401
+vt 0.425000 0.312500
+vt 0.425000 0.381401
+vt 0.450000 0.312500
+vt 0.450000 0.381401
+vt 0.475000 0.312500
+vt 0.475000 0.381401
+vt 0.500000 0.312500
+vt 0.500000 0.381401
+vt 0.525000 0.312500
+vt 0.525000 0.381401
+vt 0.550000 0.312500
+vt 0.550000 0.381401
+vt 0.575000 0.312500
+vt 0.575000 0.381401
+vt 0.600000 0.312500
+vt 0.600000 0.381401
+vt 0.625000 0.312500
+vt 0.625000 0.381401
+vt 0.548284 0.007647
+vt 0.626409 0.064409
+vt 0.500000 0.150000
+vt 0.451716 0.007647
+vt 0.373591 0.064409
+vt 0.343750 0.156250
+vt 0.373591 0.248091
+vt 0.451716 0.304853
+vt 0.548284 0.304853
+vt 0.626409 0.248091
+vt 0.656250 0.156250
+vt 0.626409 0.935591
+vt 0.548284 0.992353
+vt 0.500000 0.837500
+vt 0.451716 0.992353
+vt 0.373591 0.935591
+vt 0.343750 0.843750
+vt 0.373591 0.751909
+vt 0.451716 0.695147
+vt 0.548284 0.695147
+vt 0.626409 0.751909
+vt 0.656250 0.843750
+vt 0.600000 0.688440
+vt 0.575000 0.688440
+vt 0.550000 0.688440
+vt 0.525000 0.688440
+vt 0.500000 0.688440
+vt 0.475000 0.688440
+vt 0.450000 0.688440
+vt 0.425000 0.688440
+vt 0.400000 0.688440
+vt 0.375000 0.688440
+vt 0.625000 0.688440
+vn 0.170664 -0.972530 -0.158303
+vn 0.170664 -0.972530 -0.158303
+vn 0.170664 -0.972530 -0.158303
+vn 0.170664 -0.972530 -0.158303
+vn -0.000000 -0.979717 -0.200388
+vn -0.000000 -0.979717 -0.200388
+vn -0.000000 -0.979717 -0.200388
+vn -0.000000 -0.979717 -0.200388
+vn -0.170664 -0.972530 -0.158303
+vn -0.170664 -0.972530 -0.158303
+vn -0.170664 -0.972530 -0.158303
+vn -0.170664 -0.972530 -0.158303
+vn -0.270004 -0.961203 -0.056449
+vn -0.270003 -0.961203 -0.056449
+vn -0.270004 -0.961203 -0.056449
+vn -0.270003 -0.961203 -0.056449
+vn -0.270003 -0.961203 0.056449
+vn -0.270003 -0.961203 0.056449
+vn -0.270003 -0.961203 0.056449
+vn -0.270003 -0.961203 0.056449
+vn -0.170664 -0.972530 0.158303
+vn -0.170664 -0.972530 0.158303
+vn -0.170664 -0.972530 0.158303
+vn -0.170664 -0.972530 0.158303
+vn 0.000000 -0.979717 0.200388
+vn 0.000000 -0.979717 0.200388
+vn 0.000000 -0.979717 0.200388
+vn 0.000000 -0.979717 0.200388
+vn 0.170664 -0.972530 0.158303
+vn 0.170664 -0.972530 0.158303
+vn 0.170664 -0.972530 0.158303
+vn 0.170664 -0.972530 0.158303
+vn 0.270003 -0.961203 0.056448
+vn 0.270003 -0.961203 0.056448
+vn 0.270003 -0.961203 0.056448
+vn 0.270003 -0.961203 0.056448
+vn 0.270003 -0.961203 -0.056449
+vn 0.270003 -0.961203 -0.056449
+vn 0.270003 -0.961203 -0.056449
+vn 0.270003 -0.961203 -0.056449
+vn 0.316741 -0.897738 -0.306173
+vn 0.316741 -0.897738 -0.306173
+vn 0.316741 -0.897738 -0.306173
+vn 0.316741 -0.897738 -0.306173
+vn -0.000000 -0.919995 -0.391930
+vn -0.000000 -0.919995 -0.391930
+vn -0.000000 -0.919995 -0.391930
+vn -0.000000 -0.919995 -0.391930
+vn -0.316741 -0.897738 -0.306174
+vn -0.316741 -0.897738 -0.306174
+vn -0.316741 -0.897738 -0.306174
+vn -0.316741 -0.897738 -0.306174
+vn -0.489726 -0.865169 -0.107942
+vn -0.489726 -0.865169 -0.107942
+vn -0.489726 -0.865169 -0.107942
+vn -0.489726 -0.865169 -0.107942
+vn -0.489726 -0.865169 0.107942
+vn -0.489726 -0.865169 0.107942
+vn -0.489726 -0.865169 0.107942
+vn -0.489726 -0.865169 0.107942
+vn -0.316741 -0.897738 0.306174
+vn -0.316741 -0.897738 0.306174
+vn -0.316741 -0.897737 0.306174
+vn -0.316741 -0.897738 0.306174
+vn 0.000000 -0.919996 0.391928
+vn 0.000000 -0.919996 0.391928
+vn 0.000000 -0.919996 0.391928
+vn 0.000000 -0.919996 0.391928
+vn 0.316741 -0.897737 0.306174
+vn 0.316741 -0.897737 0.306174
+vn 0.316741 -0.897738 0.306174
+vn 0.316741 -0.897738 0.306174
+vn 0.489726 -0.865169 0.107942
+vn 0.489726 -0.865169 0.107942
+vn 0.489726 -0.865169 0.107942
+vn 0.489726 -0.865169 0.107942
+vn 0.489726 -0.865169 -0.107942
+vn 0.489726 -0.865169 -0.107942
+vn 0.489726 -0.865169 -0.107942
+vn 0.489726 -0.865169 -0.107942
+vn 0.498484 -0.718056 -0.485705
+vn 0.498484 -0.718056 -0.485705
+vn 0.498484 -0.718056 -0.485705
+vn 0.498484 -0.718056 -0.485705
+vn -0.000000 -0.767178 -0.641434
+vn -0.000000 -0.767178 -0.641434
+vn -0.000000 -0.767178 -0.641434
+vn -0.000000 -0.767178 -0.641434
+vn -0.498484 -0.718055 -0.485706
+vn -0.498484 -0.718055 -0.485706
+vn -0.498484 -0.718055 -0.485706
+vn -0.498484 -0.718055 -0.485706
+vn -0.737414 -0.654581 -0.166564
+vn -0.737414 -0.654581 -0.166564
+vn -0.737414 -0.654581 -0.166564
+vn -0.737414 -0.654581 -0.166564
+vn -0.737415 -0.654581 0.166565
+vn -0.737415 -0.654581 0.166565
+vn -0.737415 -0.654581 0.166565
+vn -0.737415 -0.654581 0.166565
+vn -0.498484 -0.718056 0.485705
+vn -0.498484 -0.718056 0.485705
+vn -0.498484 -0.718056 0.485705
+vn -0.498484 -0.718056 0.485705
+vn 0.000000 -0.767177 0.641436
+vn 0.000000 -0.767177 0.641436
+vn 0.000000 -0.767177 0.641436
+vn 0.000000 -0.767177 0.641436
+vn 0.498484 -0.718055 0.485706
+vn 0.498484 -0.718055 0.485706
+vn 0.498484 -0.718055 0.485706
+vn 0.498484 -0.718056 0.485706
+vn 0.737414 -0.654581 0.166564
+vn 0.737414 -0.654581 0.166564
+vn 0.737414 -0.654581 0.166564
+vn 0.737414 -0.654581 0.166564
+vn 0.737414 -0.654581 -0.166565
+vn 0.737414 -0.654581 -0.166565
+vn 0.737414 -0.654581 -0.166565
+vn 0.737414 -0.654581 -0.166565
+vn 0.682085 -0.305208 -0.664536
+vn 0.682085 -0.305208 -0.664536
+vn 0.682085 -0.305208 -0.664536
+vn 0.682085 -0.305208 -0.664536
+vn -0.000000 -0.348479 -0.937317
+vn -0.000000 -0.348479 -0.937317
+vn -0.000000 -0.348479 -0.937317
+vn -0.000000 -0.348479 -0.937317
+vn -0.682086 -0.305208 -0.664535
+vn -0.682086 -0.305208 -0.664535
+vn -0.682086 -0.305208 -0.664535
+vn -0.682086 -0.305208 -0.664535
+vn -0.942260 -0.256868 -0.214861
+vn -0.942260 -0.256868 -0.214861
+vn -0.942260 -0.256868 -0.214861
+vn -0.942260 -0.256868 -0.214861
+vn -0.942260 -0.256868 0.214861
+vn -0.942260 -0.256868 0.214861
+vn -0.942260 -0.256868 0.214861
+vn -0.942260 -0.256868 0.214861
+vn -0.682086 -0.305208 0.664534
+vn -0.682087 -0.305208 0.664534
+vn -0.682086 -0.305208 0.664534
+vn -0.682086 -0.305208 0.664534
+vn 0.000000 -0.348479 0.937317
+vn 0.000000 -0.348479 0.937317
+vn 0.000000 -0.348479 0.937317
+vn 0.000000 -0.348479 0.937317
+vn 0.682087 -0.305208 0.664534
+vn 0.682086 -0.305208 0.664534
+vn 0.682086 -0.305208 0.664534
+vn 0.682086 -0.305208 0.664534
+vn 0.942260 -0.256868 0.214861
+vn 0.942260 -0.256868 0.214861
+vn 0.942260 -0.256868 0.214861
+vn 0.942260 -0.256868 0.214861
+vn 0.942260 -0.256868 -0.214861
+vn 0.942260 -0.256868 -0.214861
+vn 0.942260 -0.256868 -0.214861
+vn 0.942260 -0.256868 -0.214861
+vn 0.682078 0.300575 -0.666652
+vn 0.682078 0.300574 -0.666652
+vn 0.682078 0.300575 -0.666652
+vn 0.682078 0.300575 -0.666652
+vn -0.000000 0.348478 -0.937317
+vn -0.000000 0.348478 -0.937317
+vn -0.000000 0.348479 -0.937317
+vn -0.000000 0.348479 -0.937317
+vn -0.682079 0.300575 -0.666651
+vn -0.682079 0.300575 -0.666651
+vn -0.682079 0.300575 -0.666651
+vn -0.682079 0.300575 -0.666651
+vn -0.943746 0.245925 -0.221051
+vn -0.943746 0.245925 -0.221051
+vn -0.943746 0.245925 -0.221051
+vn -0.943746 0.245925 -0.221051
+vn -0.943746 0.245925 0.221052
+vn -0.943746 0.245925 0.221052
+vn -0.943746 0.245925 0.221052
+vn -0.943746 0.245925 0.221052
+vn -0.682078 0.300575 0.666651
+vn -0.682078 0.300575 0.666652
+vn -0.682078 0.300575 0.666652
+vn -0.682078 0.300575 0.666651
+vn 0.000000 0.348478 0.937317
+vn 0.000000 0.348478 0.937317
+vn 0.000000 0.348478 0.937317
+vn 0.000000 0.348478 0.937317
+vn 0.682079 0.300575 0.666650
+vn 0.682079 0.300575 0.666650
+vn 0.682079 0.300575 0.666650
+vn 0.682079 0.300575 0.666650
+vn 0.943746 0.245925 0.221051
+vn 0.943746 0.245925 0.221051
+vn 0.943746 0.245925 0.221051
+vn 0.943746 0.245925 0.221051
+vn 0.943746 0.245926 -0.221052
+vn 0.943746 0.245926 -0.221052
+vn 0.943746 0.245926 -0.221052
+vn 0.943746 0.245926 -0.221052
+vn 0.512815 0.679822 -0.524274
+vn 0.512815 0.679822 -0.524274
+vn 0.512815 0.679822 -0.524274
+vn 0.512815 0.679822 -0.524274
+vn -0.000000 0.748135 -0.663546
+vn -0.000000 0.748135 -0.663546
+vn -0.000000 0.748135 -0.663546
+vn -0.000000 0.748135 -0.663546
+vn -0.512814 0.679821 -0.524276
+vn -0.512814 0.679821 -0.524276
+vn -0.512814 0.679821 -0.524276
+vn -0.512814 0.679821 -0.524276
+vn -0.786640 0.584554 -0.198729
+vn -0.786640 0.584554 -0.198729
+vn -0.786640 0.584554 -0.198729
+vn -0.786640 0.584554 -0.198729
+vn -0.786641 0.584554 0.198730
+vn -0.786641 0.584554 0.198730
+vn -0.786641 0.584554 0.198730
+vn -0.786641 0.584554 0.198730
+vn -0.512815 0.679822 0.524274
+vn -0.512815 0.679822 0.524274
+vn -0.512815 0.679822 0.524274
+vn -0.512815 0.679822 0.524274
+vn 0.000000 0.748134 0.663548
+vn 0.000000 0.748134 0.663548
+vn 0.000000 0.748134 0.663548
+vn 0.000000 0.748134 0.663548
+vn 0.512815 0.679822 0.524273
+vn 0.512815 0.679822 0.524273
+vn 0.512815 0.679822 0.524273
+vn 0.512815 0.679822 0.524273
+vn 0.786640 0.584554 0.198730
+vn 0.786640 0.584554 0.198730
+vn 0.786640 0.584554 0.198730
+vn 0.786640 0.584554 0.198730
+vn 0.786640 0.584554 -0.198729
+vn 0.786640 0.584554 -0.198729
+vn 0.786640 0.584554 -0.198729
+vn 0.786640 0.584554 -0.198729
+vn 0.382850 0.813048 -0.438610
+vn 0.382850 0.813048 -0.438610
+vn 0.382850 0.813048 -0.438610
+vn 0.382851 0.813048 -0.438610
+vn -0.000000 0.848847 -0.528638
+vn -0.000000 0.848847 -0.528638
+vn -0.000000 0.848848 -0.528638
+vn -0.000000 0.848847 -0.528638
+vn -0.382851 0.813048 -0.438610
+vn -0.382851 0.813048 -0.438610
+vn -0.382851 0.813048 -0.438610
+vn -0.382851 0.813048 -0.438610
+vn -0.632000 0.754259 -0.177958
+vn -0.632000 0.754259 -0.177958
+vn -0.632000 0.754259 -0.177958
+vn -0.632000 0.754259 -0.177958
+vn -0.632000 0.754259 0.177957
+vn -0.632000 0.754259 0.177957
+vn -0.632000 0.754259 0.177957
+vn -0.632000 0.754259 0.177957
+vn -0.382850 0.813048 0.438610
+vn -0.382850 0.813048 0.438610
+vn -0.382850 0.813048 0.438610
+vn -0.382850 0.813048 0.438610
+vn 0.000000 0.848848 0.528637
+vn 0.000000 0.848848 0.528637
+vn 0.000000 0.848848 0.528637
+vn 0.000000 0.848848 0.528637
+vn 0.382851 0.813048 0.438610
+vn 0.382851 0.813048 0.438610
+vn 0.382851 0.813048 0.438610
+vn 0.382851 0.813048 0.438610
+vn 0.632000 0.754259 0.177959
+vn 0.632000 0.754259 0.177959
+vn 0.632000 0.754259 0.177959
+vn 0.632000 0.754259 0.177959
+vn 0.632000 0.754259 -0.177958
+vn 0.632000 0.754259 -0.177958
+vn 0.632000 0.754259 -0.177958
+vn 0.632000 0.754259 -0.177958
+vn 0.274348 0.893301 -0.356016
+vn 0.274348 0.893301 -0.356016
+vn 0.274348 0.893301 -0.356016
+vn 0.274348 0.893301 -0.356016
+vn -0.000000 0.903625 -0.428324
+vn -0.000000 0.903625 -0.428324
+vn -0.000000 0.903625 -0.428324
+vn -0.000000 0.903625 -0.428324
+vn -0.274348 0.893300 -0.356016
+vn -0.274348 0.893301 -0.356016
+vn -0.274348 0.893301 -0.356016
+vn -0.274348 0.893300 -0.356016
+vn -0.462369 0.874813 -0.144629
+vn -0.462369 0.874813 -0.144629
+vn -0.462369 0.874813 -0.144629
+vn -0.462369 0.874813 -0.144629
+vn -0.462369 0.874812 0.144630
+vn -0.462369 0.874812 0.144630
+vn -0.462369 0.874812 0.144630
+vn -0.462369 0.874812 0.144630
+vn -0.274348 0.893301 0.356016
+vn -0.274348 0.893301 0.356016
+vn -0.274348 0.893300 0.356016
+vn -0.274348 0.893301 0.356016
+vn 0.000000 0.903625 0.428325
+vn 0.000000 0.903625 0.428325
+vn 0.000000 0.903625 0.428325
+vn 0.000000 0.903625 0.428325
+vn 0.274348 0.893300 0.356017
+vn 0.274348 0.893300 0.356017
+vn 0.274348 0.893300 0.356017
+vn 0.274348 0.893300 0.356017
+vn 0.462369 0.874813 0.144630
+vn 0.462369 0.874813 0.144630
+vn 0.462369 0.874812 0.144630
+vn 0.462369 0.874813 0.144630
+vn 0.462369 0.874812 -0.144630
+vn 0.462369 0.874812 -0.144630
+vn 0.462369 0.874812 -0.144630
+vn 0.462369 0.874812 -0.144630
+vn 0.056415 -0.997460 -0.043483
+vn 0.056415 -0.997460 -0.043483
+vn 0.056415 -0.997460 -0.043483
+vn 0.000000 -0.998402 -0.056512
+vn 0.000000 -0.998402 -0.056512
+vn 0.000000 -0.998402 -0.056512
+vn -0.056415 -0.997460 -0.043481
+vn -0.056415 -0.997460 -0.043481
+vn -0.056415 -0.997460 -0.043481
+vn -0.085813 -0.996203 -0.014712
+vn -0.085813 -0.996203 -0.014712
+vn -0.085813 -0.996203 -0.014712
+vn -0.085813 -0.996203 0.014714
+vn -0.085813 -0.996203 0.014714
+vn -0.085813 -0.996203 0.014714
+vn -0.056415 -0.997460 0.043482
+vn -0.056415 -0.997460 0.043482
+vn -0.056415 -0.997460 0.043482
+vn 0.000000 -0.998402 0.056514
+vn 0.000000 -0.998402 0.056514
+vn 0.000000 -0.998402 0.056514
+vn 0.056415 -0.997460 0.043481
+vn 0.056415 -0.997460 0.043481
+vn 0.056415 -0.997460 0.043481
+vn 0.085813 -0.996203 0.014712
+vn 0.085813 -0.996203 0.014712
+vn 0.085813 -0.996203 0.014712
+vn 0.085813 -0.996203 -0.014712
+vn 0.085813 -0.996203 -0.014712
+vn 0.085813 -0.996203 -0.014712
+vn 0.083543 0.982285 -0.167741
+vn 0.083543 0.982285 -0.167741
+vn 0.083543 0.982285 -0.167741
+vn 0.000000 0.982365 -0.186975
+vn 0.000000 0.982365 -0.186975
+vn 0.000000 0.982365 -0.186975
+vn -0.083543 0.982285 -0.167737
+vn -0.083543 0.982285 -0.167737
+vn -0.083543 0.982285 -0.167737
+vn -0.178076 0.981129 -0.075336
+vn -0.178076 0.981129 -0.075336
+vn -0.178076 0.981129 -0.075336
+vn -0.178076 0.981129 0.075336
+vn -0.178076 0.981129 0.075336
+vn -0.178076 0.981129 0.075336
+vn -0.083543 0.982285 0.167741
+vn -0.083543 0.982285 0.167741
+vn -0.083543 0.982285 0.167741
+vn 0.000000 0.982365 0.186971
+vn 0.000000 0.982365 0.186971
+vn 0.000000 0.982365 0.186971
+vn 0.083544 0.982285 0.167737
+vn 0.083544 0.982285 0.167737
+vn 0.083544 0.982285 0.167737
+vn 0.178076 0.981128 0.075340
+vn 0.178076 0.981128 0.075340
+vn 0.178076 0.981128 0.075340
+vn 0.178076 0.981129 -0.075336
+vn 0.178076 0.981129 -0.075336
+vn 0.178076 0.981129 -0.075336
+vn 0.565531 0.272557 -0.778387
+vn 0.565531 0.272557 -0.778387
+vn 0.586258 0.072045 -0.806915
+vn 0.586258 0.072045 -0.806915
+vn -0.000000 0.272557 -0.962140
+vn -0.000000 0.272557 -0.962140
+vn -0.000000 0.072045 -0.997401
+vn -0.000000 0.072045 -0.997401
+vn -0.565531 0.272557 -0.778387
+vn -0.565531 0.272557 -0.778387
+vn -0.586258 0.072045 -0.806915
+vn -0.586258 0.072045 -0.806915
+vn -0.915049 0.272558 -0.297318
+vn -0.915049 0.272558 -0.297318
+vn -0.948585 0.072045 -0.308214
+vn -0.948585 0.072045 -0.308214
+vn -0.915049 0.272558 0.297318
+vn -0.915049 0.272558 0.297318
+vn -0.948585 0.072045 0.308214
+vn -0.948585 0.072045 0.308214
+vn -0.565531 0.272557 0.778388
+vn -0.565531 0.272557 0.778388
+vn -0.586258 0.072045 0.806915
+vn -0.586258 0.072045 0.806915
+vn 0.000000 0.272557 0.962140
+vn 0.000000 0.272557 0.962140
+vn 0.000000 0.072045 0.997401
+vn 0.000000 0.072045 0.997401
+vn 0.565531 0.272557 0.778387
+vn 0.565531 0.272557 0.778387
+vn 0.586258 0.072045 0.806915
+vn 0.586258 0.072045 0.806915
+vn 0.915049 0.272558 0.297318
+vn 0.915049 0.272558 0.297318
+vn 0.948585 0.072045 0.308214
+vn 0.948585 0.072045 0.308214
+vn 0.915049 0.272558 -0.297318
+vn 0.915049 0.272558 -0.297318
+vn 0.948585 0.072045 -0.308214
+vn 0.948585 0.072045 -0.308214
+vn 0.000000 -1.000000 -0.000000
+vn 0.000000 -1.000000 0.000000
+vn 0.000000 -1.000000 -0.000000
+vn 0.000000 -1.000000 -0.000000
+vn 0.000000 -1.000000 0.000000
+vn 0.000000 -1.000000 0.000001
+vn 0.000000 -1.000000 0.000001
+vn 0.000000 -1.000000 -0.000000
+vn 0.000000 -1.000000 -0.000000
+vn 0.000000 -1.000000 0.000000
+vn 0.000000 -1.000000 0.000000
+vn 0.000000 1.000000 0.000000
+vn 0.000000 1.000000 0.000000
+vn 0.000000 1.000000 0.000001
+vn 0.000000 1.000000 -0.000001
+vn 0.000000 1.000000 -0.000001
+vn 0.000000 1.000000 0.000000
+vn 0.000000 1.000000 0.000000
+vn 0.000000 1.000000 0.000001
+vn 0.000000 1.000000 0.000001
+vn 0.000000 1.000000 0.000003
+vn 0.000000 1.000000 0.000002
+vn 0.951057 0.000000 0.309017
+vn 0.951057 0.000000 0.309017
+vn 0.587785 0.000000 0.809017
+vn 0.587785 0.000000 0.809017
+vn 0.000000 0.000000 1.000000
+vn 0.000000 0.000000 1.000000
+vn -0.587785 0.000000 0.809017
+vn -0.587785 0.000000 0.809017
+vn -0.951057 0.000000 0.309017
+vn -0.951057 0.000000 0.309017
+vn -0.951057 0.000000 -0.309017
+vn -0.951057 0.000000 -0.309017
+vn -0.587785 0.000000 -0.809017
+vn -0.587785 0.000000 -0.809017
+vn -0.000000 0.000000 -1.000000
+vn -0.000000 0.000000 -1.000000
+vn 0.587785 0.000000 -0.809017
+vn 0.587785 0.000000 -0.809017
+vn 0.951057 0.000000 -0.309017
+vn 0.951057 0.000000 -0.309017
+s off
+g pSphere2
+usemtl initialShadingGroup
+f 1/1/1 2/2/2 12/13/3 11/12/4
+f 2/2/5 3/3/6 13/14/7 12/13/8
+f 3/3/9 4/4/10 14/15/11 13/14/12
+f 4/4/13 5/5/14 15/16/15 14/15/16
+f 5/5/17 6/6/18 16/17/19 15/16/20
+f 6/6/21 7/7/22 17/18/23 16/17/24
+f 7/7/25 8/8/26 18/19/27 17/18/28
+f 8/8/29 9/9/30 19/20/31 18/19/32
+f 9/9/33 10/10/34 20/21/35 19/20/36
+f 10/10/37 1/11/38 11/22/39 20/21/40
+f 11/12/41 12/13/42 22/24/43 21/23/44
+f 12/13/45 13/14/46 23/25/47 22/24/48
+f 13/14/49 14/15/50 24/26/51 23/25/52
+f 14/15/53 15/16/54 25/27/55 24/26/56
+f 15/16/57 16/17/58 26/28/59 25/27/60
+f 16/17/61 17/18/62 27/29/63 26/28/64
+f 17/18/65 18/19/66 28/30/67 27/29/68
+f 18/19/69 19/20/70 29/31/71 28/30/72
+f 19/20/73 20/21/74 30/32/75 29/31/76
+f 20/21/77 11/22/78 21/33/79 30/32/80
+f 21/23/81 22/24/82 32/35/83 31/34/84
+f 22/24/85 23/25/86 33/36/87 32/35/88
+f 23/25/89 24/26/90 34/37/91 33/36/92
+f 24/26/93 25/27/94 35/38/95 34/37/96
+f 25/27/97 26/28/98 36/39/99 35/38/100
+f 26/28/101 27/29/102 37/40/103 36/39/104
+f 27/29/105 28/30/106 38/41/107 37/40/108
+f 28/30/109 29/31/110 39/42/111 38/41/112
+f 29/31/113 30/32/114 40/43/115 39/42/116
+f 30/32/117 21/33/118 31/44/119 40/43/120
+f 31/34/121 32/35/122 42/46/123 41/45/124
+f 32/35/125 33/36/126 43/47/127 42/46/128
+f 33/36/129 34/37/130 44/48/131 43/47/132
+f 34/37/133 35/38/134 45/49/135 44/48/136
+f 35/38/137 36/39/138 46/50/139 45/49/140
+f 36/39/141 37/40/142 47/51/143 46/50/144
+f 37/40/145 38/41/146 48/52/147 47/51/148
+f 38/41/149 39/42/150 49/53/151 48/52/152
+f 39/42/153 40/43/154 50/54/155 49/53/156
+f 40/43/157 31/44/158 41/55/159 50/54/160
+f 41/45/161 42/46/162 52/57/163 51/56/164
+f 42/46/165 43/47/166 53/58/167 52/57/168
+f 43/47/169 44/48/170 54/59/171 53/58/172
+f 44/48/173 45/49/174 55/60/175 54/59/176
+f 45/49/177 46/50/178 56/61/179 55/60/180
+f 46/50/181 47/51/182 57/62/183 56/61/184
+f 47/51/185 48/52/186 58/63/187 57/62/188
+f 48/52/189 49/53/190 59/64/191 58/63/192
+f 49/53/193 50/54/194 60/65/195 59/64/196
+f 50/54/197 41/55/198 51/66/199 60/65/200
+f 51/56/201 52/57/202 62/68/203 61/67/204
+f 52/57/205 53/58/206 63/69/207 62/68/208
+f 53/58/209 54/59/210 64/70/211 63/69/212
+f 54/59/213 55/60/214 65/71/215 64/70/216
+f 55/60/217 56/61/218 66/72/219 65/71/220
+f 56/61/221 57/62/222 67/73/223 66/72/224
+f 57/62/225 58/63/226 68/74/227 67/73/228
+f 58/63/229 59/64/230 69/75/231 68/74/232
+f 59/64/233 60/65/234 70/76/235 69/75/236
+f 60/65/237 51/66/238 61/77/239 70/76/240
+f 61/67/241 62/68/242 72/79/243 71/78/244
+f 62/68/245 63/69/246 73/80/247 72/79/248
+f 63/69/249 64/70/250 74/81/251 73/80/252
+f 64/70/253 65/71/254 75/82/255 74/81/256
+f 65/71/257 66/72/258 76/83/259 75/82/260
+f 66/72/261 67/73/262 77/84/263 76/83/264
+f 67/73/265 68/74/266 78/85/267 77/84/268
+f 68/74/269 69/75/270 79/86/271 78/85/272
+f 69/75/273 70/76/274 80/87/275 79/86/276
+f 70/76/277 61/77/278 71/88/279 80/87/280
+f 71/78/281 72/79/282 82/90/283 81/89/284
+f 72/79/285 73/80/286 83/91/287 82/90/288
+f 73/80/289 74/81/290 84/92/291 83/91/292
+f 74/81/293 75/82/294 85/93/295 84/92/296
+f 75/82/297 76/83/298 86/94/299 85/93/300
+f 76/83/301 77/84/302 87/95/303 86/94/304
+f 77/84/305 78/85/306 88/96/307 87/95/308
+f 78/85/309 79/86/310 89/97/311 88/96/312
+f 79/86/313 80/87/314 90/98/315 89/97/316
+f 80/87/317 71/88/318 81/99/319 90/98/320
+f 2/2/321 1/1/322 91/100/323
+f 3/3/324 2/2/325 91/101/326
+f 4/4/327 3/3/328 91/102/329
+f 5/5/330 4/4/331 91/103/332
+f 6/6/333 5/5/334 91/104/335
+f 7/7/336 6/6/337 91/105/338
+f 8/8/339 7/7/340 91/106/341
+f 9/9/342 8/8/343 91/107/344
+f 10/10/345 9/9/346 91/108/347
+f 1/11/348 10/10/349 91/109/350
+f 81/89/351 82/90/352 92/110/353
+f 82/90/354 83/91/355 92/111/356
+f 83/91/357 84/92/358 92/112/359
+f 84/92/360 85/93/361 92/113/362
+f 85/93/363 86/94/364 92/114/365
+f 86/94/366 87/95/367 92/115/368
+f 87/95/369 88/96/370 92/116/371
+f 88/96/372 89/97/373 92/117/374
+f 89/97/375 90/98/376 92/118/377
+f 90/98/378 81/99/379 92/119/380
+s 1
+f 93/120/381 94/121/382 123/122/383 124/123/384
+s 2
+f 94/121/385 95/124/386 122/125/387 123/122/388
+s 3
+f 95/124/389 96/126/390 121/127/391 122/125/392
+s 4
+f 96/126/393 97/128/394 120/129/395 121/127/396
+s 5
+f 97/128/397 98/130/398 119/131/399 120/129/400
+s 6
+f 98/130/401 99/132/402 118/133/403 119/131/404
+s 7
+f 99/132/405 100/134/406 117/135/407 118/133/408
+s 8
+f 100/134/409 101/136/410 116/137/411 117/135/412
+s 9
+f 101/136/413 102/138/414 115/139/415 116/137/416
+s 10
+f 102/138/417 93/140/418 124/141/419 115/139/420
+s 11
+f 94/142/421 93/143/422 113/144/423
+f 95/145/424 94/142/421 113/144/423
+f 96/146/425 95/145/424 113/144/423
+f 97/147/426 96/146/425 113/144/423
+f 98/148/427 97/147/426 113/144/423
+f 99/149/428 98/148/427 113/144/423
+f 100/150/429 99/149/428 113/144/423
+f 101/151/430 100/150/429 113/144/423
+f 102/152/431 101/151/430 113/144/423
+f 93/143/422 102/152/431 113/144/423
+s 12
+f 103/153/432 104/154/433 114/155/434
+f 104/154/433 105/156/435 114/155/434
+f 105/156/435 106/157/436 114/155/434
+f 106/157/436 107/158/437 114/155/434
+f 107/158/437 108/159/438 114/155/434
+f 108/159/438 109/160/439 114/155/434
+f 109/160/439 110/161/440 114/155/434
+f 110/161/440 111/162/441 114/155/434
+f 111/162/441 112/163/442 114/155/434
+f 112/163/442 103/153/432 114/155/434
+s 9
+f 116/137/416 115/139/415 112/164/443 111/165/444
+s 8
+f 117/135/412 116/137/411 111/165/445 110/166/446
+s 7
+f 118/133/408 117/135/407 110/166/447 109/167/448
+s 6
+f 119/131/404 118/133/403 109/167/449 108/168/450
+s 5
+f 120/129/400 119/131/399 108/168/451 107/169/452
+s 4
+f 121/127/396 120/129/395 107/169/453 106/170/454
+s 3
+f 122/125/392 121/127/391 106/170/455 105/171/456
+s 2
+f 123/122/388 122/125/387 105/171/457 104/172/458
+s 1
+f 124/123/384 123/122/383 104/172/459 103/173/460
+s 10
+f 115/139/420 124/141/419 103/174/461 112/164/462
diff --git a/package.json b/package.json
new file mode 100644
index 00000000..e99188d9
--- /dev/null
+++ b/package.json
@@ -0,0 +1,32 @@
+{
+ "scripts": {
+ "start": "webpack-dev-server --hot --inline",
+ "build": "webpack",
+ "deploy": "node deploy.js"
+ },
+ "gh-pages-deploy": {
+ "prep": [
+ "build"
+ ],
+ "noprompt": true
+ },
+ "dependencies": {
+ "dat-gui": "^0.5.0",
+ "gl-matrix": "^2.3.2",
+ "stats-js": "^1.0.0-alpha1",
+ "three": "^0.82.1",
+ "three-obj-loader": "^1.0.2",
+ "three-orbit-controls": "^82.1.0"
+ },
+ "devDependencies": {
+ "babel-core": "^6.18.2",
+ "babel-loader": "^6.2.8",
+ "babel-preset-es2015": "^6.18.0",
+ "colors": "^1.1.2",
+ "gh-pages-deploy": "^0.4.2",
+ "simple-git": "^1.65.0",
+ "webpack": "^1.13.3",
+ "webpack-dev-server": "^1.16.2",
+ "webpack-glsl-loader": "^1.0.1"
+ }
+}
diff --git a/progShots/add-road-splines.PNG b/progShots/add-road-splines.PNG
new file mode 100644
index 00000000..f1694c35
Binary files /dev/null and b/progShots/add-road-splines.PNG differ
diff --git a/progShots/back-half-height.PNG b/progShots/back-half-height.PNG
new file mode 100644
index 00000000..b4a5b214
Binary files /dev/null and b/progShots/back-half-height.PNG differ
diff --git a/progShots/c-builds-modif.PNG b/progShots/c-builds-modif.PNG
new file mode 100644
index 00000000..07b91d14
Binary files /dev/null and b/progShots/c-builds-modif.PNG differ
diff --git a/progShots/chimney.PNG b/progShots/chimney.PNG
new file mode 100644
index 00000000..bed8aebe
Binary files /dev/null and b/progShots/chimney.PNG differ
diff --git a/progShots/config1.PNG b/progShots/config1.PNG
new file mode 100644
index 00000000..de0119bb
Binary files /dev/null and b/progShots/config1.PNG differ
diff --git a/progShots/config1Add.PNG b/progShots/config1Add.PNG
new file mode 100644
index 00000000..34a352dc
Binary files /dev/null and b/progShots/config1Add.PNG differ
diff --git a/progShots/config2.PNG b/progShots/config2.PNG
new file mode 100644
index 00000000..c6521ab0
Binary files /dev/null and b/progShots/config2.PNG differ
diff --git a/progShots/config3.PNG b/progShots/config3.PNG
new file mode 100644
index 00000000..b9d9ea1e
Binary files /dev/null and b/progShots/config3.PNG differ
diff --git a/progShots/doors.PNG b/progShots/doors.PNG
new file mode 100644
index 00000000..75673e26
Binary files /dev/null and b/progShots/doors.PNG differ
diff --git a/progShots/doors2.PNG b/progShots/doors2.PNG
new file mode 100644
index 00000000..3c2eb84f
Binary files /dev/null and b/progShots/doors2.PNG differ
diff --git a/progShots/driveways.PNG b/progShots/driveways.PNG
new file mode 100644
index 00000000..2d5cfe82
Binary files /dev/null and b/progShots/driveways.PNG differ
diff --git a/progShots/final-from-above.PNG b/progShots/final-from-above.PNG
new file mode 100644
index 00000000..955fe1d5
Binary files /dev/null and b/progShots/final-from-above.PNG differ
diff --git a/progShots/final-from-side.PNG b/progShots/final-from-side.PNG
new file mode 100644
index 00000000..22d3490b
Binary files /dev/null and b/progShots/final-from-side.PNG differ
diff --git a/progShots/house-shader.PNG b/progShots/house-shader.PNG
new file mode 100644
index 00000000..67fef1e6
Binary files /dev/null and b/progShots/house-shader.PNG differ
diff --git a/progShots/houses-on-both-sides.PNG b/progShots/houses-on-both-sides.PNG
new file mode 100644
index 00000000..f82980f1
Binary files /dev/null and b/progShots/houses-on-both-sides.PNG differ
diff --git a/progShots/lampposts-closeup.PNG b/progShots/lampposts-closeup.PNG
new file mode 100644
index 00000000..706a1f0c
Binary files /dev/null and b/progShots/lampposts-closeup.PNG differ
diff --git a/progShots/original-house-geo.PNG b/progShots/original-house-geo.PNG
new file mode 100644
index 00000000..2869122d
Binary files /dev/null and b/progShots/original-house-geo.PNG differ
diff --git a/progShots/place-homes-on-road.PNG b/progShots/place-homes-on-road.PNG
new file mode 100644
index 00000000..44657606
Binary files /dev/null and b/progShots/place-homes-on-road.PNG differ
diff --git a/progShots/trees-birds-eye.PNG b/progShots/trees-birds-eye.PNG
new file mode 100644
index 00000000..362bb64e
Binary files /dev/null and b/progShots/trees-birds-eye.PNG differ
diff --git a/progShots/trees-low-view.PNG b/progShots/trees-low-view.PNG
new file mode 100644
index 00000000..8a862198
Binary files /dev/null and b/progShots/trees-low-view.PNG differ
diff --git a/progShots/two-side-roads.PNG b/progShots/two-side-roads.PNG
new file mode 100644
index 00000000..9fb48253
Binary files /dev/null and b/progShots/two-side-roads.PNG differ
diff --git a/referenceImages/15SPRAWLsub-superJumbo.jpg b/referenceImages/15SPRAWLsub-superJumbo.jpg
new file mode 100644
index 00000000..9149ee13
Binary files /dev/null and b/referenceImages/15SPRAWLsub-superJumbo.jpg differ
diff --git a/referenceImages/the-worst-sprawl1-554x413.jpg b/referenceImages/the-worst-sprawl1-554x413.jpg
new file mode 100644
index 00000000..23ce6ea0
Binary files /dev/null and b/referenceImages/the-worst-sprawl1-554x413.jpg differ
diff --git a/src/framework.js b/src/framework.js
new file mode 100644
index 00000000..76f901a5
--- /dev/null
+++ b/src/framework.js
@@ -0,0 +1,72 @@
+
+const THREE = require('three');
+const OrbitControls = require('three-orbit-controls')(THREE)
+import Stats from 'stats-js'
+import DAT from 'dat-gui'
+
+// when the scene is done initializing, the function passed as `callback` will be executed
+// then, every frame, the function passed as `update` will be executed
+function init(callback, update) {
+ var stats = new Stats();
+ stats.setMode(1);
+ stats.domElement.style.position = 'absolute';
+ stats.domElement.style.left = '0px';
+ stats.domElement.style.top = '0px';
+ document.body.appendChild(stats.domElement);
+
+ var gui = new DAT.GUI();
+
+ var framework = {
+ gui: gui,
+ stats: stats
+ };
+
+ // run this function after the window loads
+ window.addEventListener('load', function() {
+
+ var scene = new THREE.Scene();
+ var camera = new THREE.PerspectiveCamera( 75, window.innerWidth/window.innerHeight, 0.1, 1000 );
+ var renderer = new THREE.WebGLRenderer( { antialias: true } );
+ renderer.setPixelRatio(window.devicePixelRatio);
+ renderer.setSize(window.innerWidth, window.innerHeight);
+ renderer.setClearColor(0x020202, 0);
+
+ var controls = new OrbitControls(camera, renderer.domElement);
+ controls.enableDamping = true;
+ controls.enableZoom = true;
+ controls.target.set(0, 0, 0);
+ controls.rotateSpeed = 0.3;
+ controls.zoomSpeed = 1.0;
+ controls.panSpeed = 2.0;
+
+ document.body.appendChild(renderer.domElement);
+
+ // resize the canvas when the window changes
+ window.addEventListener('resize', function() {
+ camera.aspect = window.innerWidth / window.innerHeight;
+ camera.updateProjectionMatrix();
+ renderer.setSize(window.innerWidth, window.innerHeight);
+ }, false);
+
+ // assign THREE.js objects to the object we will return
+ framework.scene = scene;
+ framework.camera = camera;
+ framework.renderer = renderer;
+
+ // begin the animation loop
+ (function tick() {
+ stats.begin();
+ update(framework); // perform any requested updates
+ renderer.render(scene, camera); // render the scene
+ stats.end();
+ requestAnimationFrame(tick); // register to call this again when the browser renders a new frame
+ })();
+
+ // we will pass the scene, gui, renderer, camera, etc... to the callback function
+ return callback(framework);
+ });
+}
+
+export default {
+ init: init
+}
\ No newline at end of file
diff --git a/src/lsystem.js b/src/lsystem.js
new file mode 100644
index 00000000..c065caea
--- /dev/null
+++ b/src/lsystem.js
@@ -0,0 +1,551 @@
+const THREE = require('three')
+
+var shapeSet;
+
+// A class that represents a symbol replacement rule to
+// be used when expanding an L-system grammar.
+function Rule(prob, func) {
+ this.probability = prob; // The probability that this Rule will be used when replacing a shape in the grammar
+ this.func = func;
+}
+
+
+ function Shape(symbol, pos, rot, scale, material, x, z, door) {
+ // if we want to access these later, we need to bind them to 'this'
+ this.symbol = symbol;
+ this.pos = pos; //position of center of geometry
+ this.rot = rot;
+ this.scale = scale; //scale on geometry
+ this.material = material;
+ this.xaxis = x;
+ this.zaxis = z; // x and z used to move position based on current rotation
+ this.hasDoor = door;
+}
+
+function config1(initShape, s) //subdivide in z, make front half half the width and shift to one side
+{
+ if(shapeSet.size != 0)
+ {
+ var scale1 = new THREE.Vector3(initShape.scale.x, initShape.scale.y, initShape.scale.z);
+ scale1.x *= 0.5;
+ var pos1 = new THREE.Vector3(initShape.pos.x, initShape.pos.y, initShape.pos.z);
+ pos1.x = pos1.x - 0.75*initShape.xaxis.x;
+ pos1.y = pos1.y - 0.75*initShape.xaxis.y;
+ pos1.z = pos1.z - 0.75*initShape.xaxis.z;
+ shapeSet.add(new Shape('D', pos1, initShape.rot, scale1, initShape.material, initShape.xaxis, initShape.zaxis , false));
+
+ var scale2 = new THREE.Vector3(initShape.scale.x, initShape.scale.y, initShape.scale.z);
+ scale2.x *= 0.5;
+ scale2.z *= 0.5;
+ var pos2 = new THREE.Vector3(initShape.pos.x, initShape.pos.y, initShape.pos.z);
+ pos2.x = pos2.x + 0.75*initShape.xaxis.x;
+ pos2.y = pos2.y + 0.75*initShape.xaxis.y;
+ pos2.z = pos2.z + 0.75*initShape.xaxis.z;
+
+ var rando = Math.random(); //decides if front piece goes on left or right of the house
+ if(rando < 0.5)
+ {
+ pos2.x = pos2.x - 1.0*initShape.zaxis.x;
+ pos2.y = pos2.y - 1.0*initShape.zaxis.y;
+ pos2.z = pos2.z - 1.0*initShape.zaxis.z;
+ shapeSet.add(new Shape('B', pos2, initShape.rot, scale2, initShape.material, initShape.xaxis, initShape.zaxis, false));
+ }
+ else
+ {
+ pos2.x = pos2.x + 1.0*initShape.zaxis.x;
+ pos2.y = pos2.y + 1.0*initShape.zaxis.y;
+ pos2.z = pos2.z + 1.0*initShape.zaxis.z;
+ shapeSet.add(new Shape('E', pos2, initShape.rot, scale2, initShape.material, initShape.xaxis, initShape.zaxis), false);
+ }
+
+ shapeSet.delete(initShape);
+ }
+}
+
+function config2(initShape, s) //subdivide in z, make two new shapes rotated to face front in front half
+{
+ if(shapeSet.size != 0)
+ {
+ var scale1 = new THREE.Vector3(initShape.scale.x, initShape.scale.y, initShape.scale.z);
+ scale1.x *= 0.5;
+ var pos1 = new THREE.Vector3(initShape.pos.x, initShape.pos.y, initShape.pos.z);
+ pos1.x = pos1.x - 0.75*initShape.xaxis.x;
+ pos1.y = pos1.y - 0.75*initShape.xaxis.y;
+ pos1.z = pos1.z - 0.75*initShape.xaxis.z;
+ shapeSet.add(new Shape('D', pos1, initShape.rot, scale1, initShape.material, initShape.xaxis, initShape.zaxis, false));
+
+ var scale2 = new THREE.Vector3(initShape.scale.x, initShape.scale.y, initShape.scale.z);
+ scale2.x *= 0.4;
+ scale2.z *= 0.5;
+ var rot = new THREE.Vector3(initShape.rot.x, initShape.rot.y, initShape.rot.z);
+ rot.y += 3.1415/2.0;
+ var xax = new THREE.Vector3(initShape.xaxis.x, initShape.xaxis.y, initShape.xaxis.z);
+ xax.applyAxisAngle(new THREE.Vector3(0, 1, 0), 3.1415/2.0);
+ var zax = new THREE.Vector3(initShape.zaxis.x, initShape.zaxis.y, initShape.zaxis.z);
+ zax.applyAxisAngle(new THREE.Vector3(0, 1, 0), 3.1415/2.0);
+
+ var pos2 = new THREE.Vector3(initShape.pos.x, initShape.pos.y, initShape.pos.z);
+ pos2.x = pos2.x + 0.5*initShape.xaxis.x;
+ pos2.y = pos2.y + 0.5*initShape.xaxis.y;
+ pos2.z = pos2.z + 0.5*initShape.xaxis.z;
+ pos2.x = pos2.x - 1.25*initShape.zaxis.x;
+ pos2.y = pos2.y - 1.25*initShape.zaxis.y;
+ pos2.z = pos2.z - 1.25*initShape.zaxis.z;
+ var shape2 = new Shape('C', pos2, rot, scale2, initShape.material, xax, zax, false);
+ shapeSet.add(shape2);
+
+ var pos3 = new THREE.Vector3(initShape.pos.x, initShape.pos.y, initShape.pos.z);
+ pos3.x = pos3.x + 0.5*initShape.xaxis.x;
+ pos3.y = pos3.y + 0.5*initShape.xaxis.y;
+ pos3.z = pos3.z + 0.5*initShape.xaxis.z;
+ pos3.x = pos3.x + 1.25*initShape.zaxis.x;
+ pos3.y = pos3.y + 1.25*initShape.zaxis.y;
+ pos3.z = pos3.z + 1.25*initShape.zaxis.z;
+ var shape3 = new Shape('C', pos3, rot, scale2, initShape.material, xax, zax, false);
+ shapeSet.add(shape3);
+
+ var rando = Math.random();
+ if(rando < 0.5)
+ {
+ shape2.hasDoor = true;
+ }
+ else
+ {
+ shape3.hasDoor = true;
+ }
+
+ shapeSet.delete(initShape);
+ }
+}
+
+function config3(initShape, s) //subdivide in z, make three new shapes rotated to face front in front half
+{
+ if(shapeSet.size != 0)
+ {
+ var scale1 = new THREE.Vector3(initShape.scale.x, initShape.scale.y, initShape.scale.z);
+ scale1.x *= 0.5;
+ var pos1 = new THREE.Vector3(initShape.pos.x, initShape.pos.y, initShape.pos.z);
+ pos1.x = pos1.x - 0.75*initShape.xaxis.x;
+ pos1.y = pos1.y - 0.75*initShape.xaxis.y;
+ pos1.z = pos1.z - 0.75*initShape.xaxis.z;
+ shapeSet.add(new Shape('D', pos1, initShape.rot, scale1, initShape.material, initShape.xaxis, initShape.zaxis));
+
+ var scale2 = new THREE.Vector3(initShape.scale.x, initShape.scale.y, initShape.scale.z);
+ scale2.x *= 0.3;
+ scale2.z *= 0.5;
+ var rot = new THREE.Vector3(initShape.rot.x, initShape.rot.y, initShape.rot.z);
+ rot.y += 3.1415/2.0;
+ var xax = new THREE.Vector3(initShape.xaxis.x, initShape.xaxis.y, initShape.xaxis.z);
+ xax.applyAxisAngle(new THREE.Vector3(0, 1, 0), 3.1415/2.0);
+ var zax = new THREE.Vector3(initShape.zaxis.x, initShape.zaxis.y, initShape.zaxis.z);
+ zax.applyAxisAngle(new THREE.Vector3(0, 1, 0), 3.1415/2.0);
+
+ var pos2 = new THREE.Vector3(initShape.pos.x, initShape.pos.y, initShape.pos.z);
+ pos2.x = pos2.x + 0.5*initShape.xaxis.x;
+ pos2.y = pos2.y + 0.5*initShape.xaxis.y;
+ pos2.z = pos2.z + 0.5*initShape.xaxis.z;
+ var shape2 = new Shape('C', pos2, rot, scale2, initShape.material, xax, zax, false);
+ shapeSet.add(shape2);
+
+ var pos3 = new THREE.Vector3(initShape.pos.x, initShape.pos.y, initShape.pos.z);
+ pos3.x = pos3.x + 0.5*initShape.xaxis.x;
+ pos3.y = pos3.y + 0.5*initShape.xaxis.y;
+ pos3.z = pos3.z + 0.5*initShape.xaxis.z;
+ pos3.x = pos3.x - 1.6*initShape.zaxis.x;
+ pos3.y = pos3.y - 1.6*initShape.zaxis.y;
+ pos3.z = pos3.z - 1.6*initShape.zaxis.z;
+ var shape3 = new Shape('C', pos3, rot, scale2, initShape.material, xax, zax, false);
+ shapeSet.add(shape3);
+
+ var pos4 = new THREE.Vector3(initShape.pos.x, initShape.pos.y, initShape.pos.z);
+ pos4.x = pos4.x + 0.5*initShape.xaxis.x;
+ pos4.y = pos4.y + 0.5*initShape.xaxis.y;
+ pos4.z = pos4.z + 0.5*initShape.xaxis.z;
+ pos4.x = pos4.x + 1.6*initShape.zaxis.x;
+ pos4.y = pos4.y + 1.6*initShape.zaxis.y;
+ pos4.z = pos4.z + 1.6*initShape.zaxis.z;
+ var shape4 = new Shape('C', pos4, rot, scale2, initShape.material, xax, zax, false);
+ shapeSet.add(shape4);
+
+ var rando = Math.random();
+ if(rando < 0.333)
+ {
+ shape2.hasDoor = true;
+ }
+ else if (rando < 0.666)
+ {
+ shape3.hasDoor = true;
+ }
+ else
+ {
+ shape4.hasDoor = true;
+ }
+
+ shapeSet.delete(initShape);
+ }
+}
+
+function modif1(initShape, s) //add half sized shape to left side of parent shape
+{
+ if(shapeSet.size != 0)
+ {
+ var scale1 = new THREE.Vector3(initShape.scale.x, initShape.scale.y, initShape.scale.z);
+ scale1.x *= 0.5;
+ scale1.y *= 0.75;
+ scale1.z *= 0.5;
+ var pos1 = new THREE.Vector3(initShape.pos.x, initShape.pos.y, initShape.pos.z);
+ pos1.x = pos1.x + 1.75*initShape.zaxis.x;
+ pos1.y = pos1.y + 1.75*initShape.zaxis.y;
+ pos1.z = pos1.z + 1.75*initShape.zaxis.z;
+ pos1.y -= 0.25;
+ shapeSet.add(new Shape('T', pos1, initShape.rot, scale1, initShape.material, initShape.xaxis, initShape.zaxis, false));
+
+ var scale = new THREE.Vector3(0.5, 1.0, 0.1);
+ var pos2 = new THREE.Vector3(initShape.pos.x, initShape.pos.y, initShape.pos.z);
+ pos2.x = pos2.x + 2.4*initShape.zaxis.x;
+ pos2.y = pos2.y + 2.4*initShape.zaxis.y;
+ pos2.z = pos2.z + 2.4*initShape.zaxis.z;
+ pos2.y -= 0.5;
+ pos2.x = pos2.x + .15*initShape.xaxis.x;
+ pos2.y = pos2.y + .15*initShape.xaxis.y;
+ pos2.z = pos2.z + .15*initShape.xaxis.z;
+ shapeSet.add(new Shape('G', pos2, initShape.rot, scale, initShape.material, initShape.xaxis, initShape.zaxis, false));
+ }
+}
+
+function modif2(initShape, s) //add half sized shape to right side of parent shape
+{
+ if(shapeSet.size != 0)
+ {
+ var scale1 = new THREE.Vector3(initShape.scale.x, initShape.scale.y, initShape.scale.z);
+ scale1.x *= 0.5;
+ scale1.y *= 0.75;
+ scale1.z *= 0.5;
+ var pos1 = new THREE.Vector3(initShape.pos.x, initShape.pos.y, initShape.pos.z);
+ pos1.x = pos1.x - 1.75*initShape.zaxis.x;
+ pos1.y = pos1.y - 1.75*initShape.zaxis.y;
+ pos1.z = pos1.z - 1.75*initShape.zaxis.z;
+ pos1.y -= 0.25;
+ shapeSet.add(new Shape('T', pos1, initShape.rot, scale1, initShape.material, initShape.xaxis, initShape.zaxis));
+
+ var scale = new THREE.Vector3(0.5, 1.0, 0.1);
+ var pos2 = new THREE.Vector3(initShape.pos.x, initShape.pos.y, initShape.pos.z);
+ pos2.x = pos2.x - 2.4*initShape.zaxis.x;
+ pos2.y = pos2.y - 2.4*initShape.zaxis.y;
+ pos2.z = pos2.z - 2.4*initShape.zaxis.z;
+ pos2.x = pos2.x + .15*initShape.xaxis.x;
+ pos2.y = pos2.y + .15*initShape.xaxis.y;
+ pos2.z = pos2.z + .15*initShape.xaxis.z;
+ pos2.y -= 0.5;
+ shapeSet.add(new Shape('G', pos2, initShape.rot, scale, initShape.material, initShape.xaxis, initShape.zaxis, false));
+ }
+}
+
+function modif3(initShape, s) //remove this shape returning empty set
+{
+ if(shapeSet.size != 0)
+ {
+ shapeSet.delete(initShape);
+
+ if(initShape.hasDoor)
+ {
+ var scale = new THREE.Vector3(0.5, 1.0, 0.1);
+ var pos1 = new THREE.Vector3(initShape.pos.x, initShape.pos.y, initShape.pos.z);
+ pos1.y -= 0.5;
+ shapeSet.add(new Shape('G', pos1, initShape.rot, scale, initShape.material, initShape.xaxis, initShape.zaxis, false));
+ }
+ }
+}
+
+function modif4(initShape, s) //do nothing to this shape, return it unchanged
+{
+ if(shapeSet != 0)
+ {
+ if(initShape.hasDoor)
+ {
+ var scale = new THREE.Vector3(0.5, 1.0, 0.1);
+ var pos1 = new THREE.Vector3(initShape.pos.x, initShape.pos.y, initShape.pos.z);
+ pos1.x = pos1.x + 1.25*initShape.zaxis.x;
+ pos1.y = pos1.y + 1.25*initShape.zaxis.y;
+ pos1.z = pos1.z + 1.25*initShape.zaxis.z;
+ pos1.y -= 0.5;
+ shapeSet.add(new Shape('G', pos1, initShape.rot, scale, initShape.material, initShape.xaxis, initShape.zaxis, false));
+ }
+ }
+}
+
+function modif5(initShape, s) //scale height of this shape by 1.25
+{
+ if(shapeSet.size != 0)
+ {
+ var scale1 = new THREE.Vector3(initShape.scale.x, initShape.scale.y, initShape.scale.z);
+ scale1.y *= 1.25;
+ var pos1 = new THREE.Vector3(initShape.pos.x, initShape.pos.y, initShape.pos.z);
+ pos1.y += 0.25;
+ shapeSet.add(new Shape('T', pos1, initShape.rot, scale1, initShape.material, initShape.xaxis, initShape.zaxis));
+
+ shapeSet.delete(initShape);
+
+ if(initShape.hasDoor)
+ {
+ var scale = new THREE.Vector3(0.5, 1.0, 0.1);
+ var pos2 = new THREE.Vector3(initShape.pos.x, initShape.pos.y, initShape.pos.z);
+ pos2.x = pos2.x + 1.25*initShape.zaxis.x;
+ pos2.y = pos2.y + 1.25*initShape.zaxis.y;
+ pos2.z = pos2.z + 1.25*initShape.zaxis.z;
+ pos2.y -= 0.5;
+ shapeSet.add(new Shape('G', pos2, initShape.rot, scale, initShape.material, initShape.xaxis, initShape.zaxis, false));
+ }
+ }
+}
+
+function modif6(initShape, s) //scale height of this shape by 1.5
+{
+ if(shapeSet.size != 0)
+ {
+ var scale1 = new THREE.Vector3(initShape.scale.x, initShape.scale.y, initShape.scale.z);
+ scale1.y *= 1.5;
+ var pos1 = new THREE.Vector3(initShape.pos.x, initShape.pos.y, initShape.pos.z);
+ pos1.y += 0.5;
+ shapeSet.add(new Shape('T', pos1, initShape.rot, scale1, initShape.material, initShape.xaxis, initShape.zaxis));
+
+ shapeSet.delete(initShape);
+
+ if(initShape.hasDoor)
+ {
+ var scale = new THREE.Vector3(0.5, 1.0, 0.1);
+ var pos2 = new THREE.Vector3(initShape.pos.x, initShape.pos.y, initShape.pos.z);
+ pos2.x = pos2.x + 1.25*initShape.zaxis.x;
+ pos2.y = pos2.y + 1.25*initShape.zaxis.y;
+ pos2.z = pos2.z + 1.25*initShape.zaxis.z;
+ pos2.y -= 0.5;
+ shapeSet.add(new Shape('G', pos2, initShape.rot, scale, initShape.material, initShape.xaxis, initShape.zaxis, false));
+ }
+ }
+}
+
+function modif7(initShape, s) //scale height by 1.5, add a chimney on left side
+{
+ if(shapeSet.size != 0)
+ {
+ var scale1 = new THREE.Vector3(initShape.scale.x, initShape.scale.y, initShape.scale.z);
+ scale1.y *= 1.5;
+ var pos1 = new THREE.Vector3(initShape.pos.x, initShape.pos.y, initShape.pos.z);
+ pos1.y += 0.5;
+ shapeSet.add(new Shape('T', pos1, initShape.rot, scale1, initShape.material, initShape.xaxis, initShape.zaxis));
+
+ shapeSet.delete(initShape);
+
+ var scale = new THREE.Vector3(0.5, 5.0, 0.5);
+ var pos2 = new THREE.Vector3(initShape.pos.x, initShape.pos.y, initShape.pos.z);
+ pos2.y += 2.0;
+ pos2.x = pos2.x - 1.5*initShape.zaxis.x;
+ pos2.y = pos2.y - 1.5*initShape.zaxis.y;
+ pos2.z = pos2.z - 1.5*initShape.zaxis.z;
+ pos2.x = pos2.x - 0.5*initShape.xaxis.x;
+ pos2.y = pos2.y - 0.5*initShape.xaxis.y;
+ pos2.z = pos2.z - 0.5*initShape.xaxis.z;
+ shapeSet.add(new Shape('F', pos2, initShape.rot, scale, initShape.material, initShape.xaxis, initShape.zaxis));
+ }
+}
+
+function modif8(initShape, s) //scale height by 1.5, add a chimney on right side
+{
+ if(shapeSet.size != 0)
+ {
+ var scale1 = new THREE.Vector3(initShape.scale.x, initShape.scale.y, initShape.scale.z);
+ scale1.y *= 1.5;
+ var pos1 = new THREE.Vector3(initShape.pos.x, initShape.pos.y, initShape.pos.z);
+ pos1.y += 0.5;
+ shapeSet.add(new Shape('T', pos1, initShape.rot, scale1, initShape.material, initShape.xaxis, initShape.zaxis));
+
+ shapeSet.delete(initShape);
+
+ var scale = new THREE.Vector3(0.5, 5.0, 0.5);
+ var pos2 = new THREE.Vector3(initShape.pos.x, initShape.pos.y, initShape.pos.z);
+ pos2.y += 2.0;
+ pos2.x = pos2.x + 1.5*initShape.zaxis.x;
+ pos2.y = pos2.y + 1.5*initShape.zaxis.y;
+ pos2.z = pos2.z + 1.5*initShape.zaxis.z;
+ pos2.x = pos2.x - 0.5*initShape.xaxis.x;
+ pos2.y = pos2.y - 0.5*initShape.xaxis.y;
+ pos2.z = pos2.z - 0.5*initShape.xaxis.z;
+ shapeSet.add(new Shape('F', pos2, initShape.rot, scale, initShape.material, initShape.xaxis, initShape.zaxis));
+ }
+}
+
+function modif9(initShape, s) //don't scale height, add a chimney on left side
+{
+ if(shapeSet.size != 0)
+ {
+ var scale = new THREE.Vector3(0.5, 4.0, 0.5);
+ var pos2 = new THREE.Vector3(initShape.pos.x, initShape.pos.y, initShape.pos.z);
+ pos2.y += 1.0;
+ pos2.x = pos2.x - 1.5*initShape.zaxis.x;
+ pos2.y = pos2.y - 1.5*initShape.zaxis.y;
+ pos2.z = pos2.z - 1.5*initShape.zaxis.z;
+ pos2.x = pos2.x - 0.5*initShape.xaxis.x;
+ pos2.y = pos2.y - 0.5*initShape.xaxis.y;
+ pos2.z = pos2.z - 0.5*initShape.xaxis.z;
+ shapeSet.add(new Shape('F', pos2, initShape.rot, scale, initShape.material, initShape.xaxis, initShape.zaxis));
+ }
+}
+
+function modif10(initShape, s) //don't scale height, add a chimney on right side
+{
+ if(shapeSet.size != 0)
+ {
+ var scale = new THREE.Vector3(0.5, 4.0, 0.5);
+ var pos2 = new THREE.Vector3(initShape.pos.x, initShape.pos.y, initShape.pos.z);
+ pos2.y += 1.0;
+ pos2.x = pos2.x + 1.5*initShape.zaxis.x;
+ pos2.y = pos2.y + 1.5*initShape.zaxis.y;
+ pos2.z = pos2.z + 1.5*initShape.zaxis.z;
+ pos2.x = pos2.x - 0.5*initShape.xaxis.x;
+ pos2.y = pos2.y - 0.5*initShape.xaxis.y;
+ pos2.z = pos2.z - 0.5*initShape.xaxis.z;
+ shapeSet.add(new Shape('F', pos2, initShape.rot, scale, initShape.material, initShape.xaxis, initShape.zaxis));
+ }
+}
+
+function parseA(initShape, s)
+{
+ var rando = Math.random();
+
+ if(rando < 0.2)
+ {
+ config1(initShape, s);
+ }
+ else if(rando < 0.6)
+ {
+ config2(initShape, s);
+ }
+ else
+ {
+ config3(initShape, s);
+ }
+}
+
+function parseC(initShape, s)
+{
+ var rando = Math.random();
+
+ var prob1;
+ var prob2;
+ var t = (initShape.pos.z + 40.0)/80.0;
+
+ prob1 = 0.9*(t) + 0.3*(1-t);
+ prob2 = 0.2 + (prob1 - 0.2)/2.0;
+
+ if(rando < 0.2)
+ {
+ modif3(initShape, s);
+ }
+ else if(rando < prob2)
+ {
+ modif4(initShape, s);
+ }
+ else if(rando < prob1)
+ {
+ modif5(initShape, s);
+ }
+ else
+ {
+ modif6(initShape, s);
+ }
+}
+
+function parseD(initShape, s)
+{
+ var rando = Math.random();
+
+ var prob1;
+ var prob2;
+ var prob3;
+ var t = (initShape.pos.z + 40.0)/80.0;
+
+ prob1 = 0.8*(1-t) + 0.2*t;
+ prob2 = prob1/2.0;
+ prob3 = prob1 + (1-prob1)/2.0;
+
+ if(rando < prob2)
+ {
+ modif7(initShape, s);
+ }
+ else if(rando < prob1)
+ {
+ modif8(initShape, s);
+ }
+ else if(rando < prob3)
+ {
+ modif9(initShape, s);
+ }
+ else
+ {
+ modif10(initShape, s);
+ }
+}
+
+export default function Lsystem(axiom, grammar, iterations) {
+ // default LSystem
+ this.axiom = "A";
+ shapeSet = new Set();
+
+ // Set up the axiom string
+ if (typeof axiom !== "undefined") {
+ this.axiom = axiom;
+ }
+
+ // Set up the grammar as a dictionary that
+ // maps a single character (symbol) to a Rule.
+ if (typeof grammar !== "undefined") {
+ this.grammar = Object.assign({}, grammar);
+ }
+
+ // Set up iterations (the number of times you
+ // should expand the axiom in DoIterations)
+ if (typeof iterations !== "undefined") {
+ this.iterations = iterations;
+ }
+
+ // TODO
+ // This function returns a linked list that is the result
+ // of expanding the L-system's axiom n times.
+ // The implementation we have provided you just returns a linked
+ // list of the axiom.
+ this.doIterations = function(n, startPos, startRot, startScale, material, xaxis, zaxis, door) {
+ shapeSet.clear();
+ var initShape = new Shape('A', startPos, startRot, startScale, material, xaxis, zaxis, door);
+ shapeSet.add(initShape);
+
+ for(var i = 0; i < n; i++)
+ {
+ var temp = shapeSet;
+ temp.forEach(function(shape)
+ {
+ if(shape.symbol == 'A')
+ {
+ parseA(shape, shapeSet);
+ }
+ else if(shape.symbol == 'B')
+ {
+ modif1(shape, shapeSet);
+ }
+ else if(shape.symbol == 'C')
+ {
+ parseC(shape, shapeSet);
+ }
+ else if(shape.symbol == 'D')
+ {
+ parseD(shape, shapeSet);
+ }
+ else if(shape.symbol == 'E')
+ {
+ modif2(shape, shapeSet);
+ }
+ });
+
+ }
+ return shapeSet;
+ }
+}
\ No newline at end of file
diff --git a/src/main.js b/src/main.js
new file mode 100644
index 00000000..ac88b060
--- /dev/null
+++ b/src/main.js
@@ -0,0 +1,278 @@
+
+const THREE = require('three'); // older modules are imported like this. You shouldn't have to worry about this much
+var OBJLoader = require('three-obj-loader');
+OBJLoader(THREE);
+import Framework from './framework'
+import Lsystem, {LinkedListToString} from './lsystem.js'
+import Turtle from './turtle.js'
+
+var lsys;
+var turtle;
+var numIters;
+var flowerGeo;
+var time;
+
+// called after the scene loads
+function onLoad(framework) {
+ var scene = framework.scene;
+ var camera = framework.camera;
+ var renderer = framework.renderer;
+ var gui = framework.gui;
+ var stats = framework.stats;
+
+ // initialize a simple box and material
+ var directionalLight = new THREE.PointLight( 0xffffff, 1 );
+ directionalLight.color.setHSL(0.1, 1, 0.95);
+ directionalLight.position.set(1, 5, 5);
+ directionalLight.position.multiplyScalar(10);
+ scene.add(directionalLight);
+
+ // set camera position
+ camera.position.set(0, 20, 20);
+ camera.lookAt(new THREE.Vector3(0, 0, 0));
+
+ var loader = new THREE.TextureLoader();
+ var background = new THREE.TextureLoader().load('Sky-Blue-Sky.jpg');
+ scene.background = background;
+
+ //ground plane of grass
+ var geometry = new THREE.PlaneGeometry( 160, 160 );
+ var material = new THREE.MeshLambertMaterial( {color: 0x1eef0f, side: THREE.DoubleSide} );
+ var plane = new THREE.Mesh( geometry, material );
+ plane.position.set(0,-1.01,0);
+ plane.rotation.set(3.1415/2.0, 0, 0);
+ plane.receiveShadows = true;
+ scene.add(plane);
+
+ //build layout
+ var roadGeo = new THREE.PlaneGeometry( 2, 2 );
+ var roadMaterial = new THREE.MeshLambertMaterial( {color: 0x8d8d8d, side: THREE.DoubleSide} );
+
+ for(var i = 0; i < 60; i++)
+ {
+ var road1 = new THREE.Mesh( roadGeo, roadMaterial );
+ road1.position.set(-60, -1, (i - 30)*2);
+ road1.rotation.set(3.1415/2.0, 0, 0);
+ scene.add(road1);
+ var road2 = new THREE.Mesh( roadGeo, roadMaterial );
+ road2.position.set(60, -1, (i - 30)*2);
+ road2.rotation.set(3.1415/2.0, 0, 0);
+ scene.add(road2);
+ }
+
+ var curves = new Array(5);
+
+ for(var i = -40; i <= 40; i += 20)
+ {
+ var points = new Array(5);
+ for(var j = -60; j <= 60; j += 30)
+ {
+ var offset = Math.random() * 10 - 5;
+ points[(j + 60)/30] = (new THREE.Vector3(j, -1, i + offset));
+ }
+ curves[(i + 40)/20] = (new THREE.CatmullRomCurve3( [
+ points[0], points[1], points[2], points[3], points[4]
+ ] ));
+ }
+
+ // initialize LSystem and a Turtle to draw
+ turtle = new Turtle(scene);
+
+ for(var i = 0; i < curves.length; i++)
+ {
+ var thisCurve = curves[i];
+ for(var j = 0; j < 100; j++)
+ {
+ var road = new THREE.Mesh( roadGeo, roadMaterial );
+ road.position.set(thisCurve.getPoints(100)[j].x, thisCurve.getPoints(100)[j].y, thisCurve.getPoints(100)[j].z);
+ road.rotation.set(3.1415/2.0, 0, 0);
+ scene.add(road);
+ }
+ for(var k = 4; k < thisCurve.getLength() - 8; k += 8)
+ {
+ var len = Math.floor(thisCurve.getLength()/8);
+ var pos = new THREE.Vector3(thisCurve.getPoints(len)[(k+4)/8].x, thisCurve.getPoints(len)[(k+4)/8].y + 1, thisCurve.getPoints(len)[(k+4)/8].z + 4);
+ var ang = thisCurve.getTangent((k+4)/8).angleTo(new THREE.Vector3(0, 0, 1));
+ var rot = new THREE.Vector3(0, ang, 0);
+ var zaxis = thisCurve.getTangent((k+4)/8);
+ var xaxis = new THREE.Vector3(zaxis.x, zaxis.y, zaxis.z);
+ xaxis.applyAxisAngle(new THREE.Vector3(0, 1, 0), 3.1415/2.0);
+ lsys = new Lsystem();
+ doLsystem(lsys, 2, turtle, pos, rot, xaxis, zaxis);
+ var road1 = new THREE.Mesh( roadGeo, roadMaterial );
+ road1.position.set(thisCurve.getPoints(len)[(k+4)/8].x - 1, thisCurve.getPoints(len)[(k+4)/8].y, thisCurve.getPoints(len)[(k+4)/8].z + 1.5);
+ road1.rotation.set(3.1415/2.0, 0, 0);
+ scene.add(road1);
+
+ var pos = new THREE.Vector3(thisCurve.getPoints(len)[(k+4)/8].x, thisCurve.getPoints(len)[(k+4)/8].y + 1, thisCurve.getPoints(len)[(k+4)/8].z - 4);
+ var ang = thisCurve.getTangent((k+4)/8).angleTo(new THREE.Vector3(0, 0, 1));
+ var rot = new THREE.Vector3(0, ang + 3.1415, 0);
+ var tang = thisCurve.getTangent((k+4)/8);
+ var zaxis = new THREE.Vector3(-tang.x, tang.y, -tang.z);
+ var xaxis = new THREE.Vector3(zaxis.x, zaxis.y, zaxis.z);
+ xaxis.applyAxisAngle(new THREE.Vector3(0, 1, 0), 3.1415/2.0);
+ lsys = new Lsystem();
+ doLsystem(lsys, 2, turtle, pos, rot, xaxis, zaxis);
+ var road2 = new THREE.Mesh( roadGeo, roadMaterial );
+ road2.position.set(thisCurve.getPoints(len)[(k+4)/8].x + 1, thisCurve.getPoints(len)[(k+4)/8].y, thisCurve.getPoints(len)[(k+4)/8].z - 1.5);
+ road2.rotation.set(3.1415/2.0, 0, 0);
+ scene.add(road2);
+ }
+ }
+
+ var objLoader = new THREE.OBJLoader();
+ objLoader.load('tree.obj', function(obj){
+
+ // LOOK: This function runs after the obj has finished loading
+ var treeGeo = obj.children[0].geometry;
+ var material = new THREE.MeshLambertMaterial( {color: 0xffffff, side: THREE.DoubleSide} );
+ var green = new THREE.Vector3((31.0/255.0), (102.0/255.0), (45.0/255.0));
+ var brown = new THREE.Vector3((110.0/255.0), (58.0/255.0), (23.0/255.0));
+ var treeColor = new THREE.ShaderMaterial({
+ uniforms: {
+ roofColor: {value: green},
+ wallColor: {value: brown},
+ },
+ //using my own shaders to create white pink gradient
+ vertexShader: require('./shaders/house-vert.glsl'),
+ fragmentShader: require('./shaders/house-frag.glsl')
+ });
+
+ for(var i = 0; i < curves.length-1; i++)
+ {
+ for(var j = 5; j < 95; j += 2)
+ {
+ var zlow = curves[i].getPoints(100)[j].z;
+ var zhigh = curves[i+1].getPoints(100)[j].z;
+ var zdist = zhigh - zlow;
+ //console.log(zdist);
+ if(zdist > 16)
+ {
+ for(var k = zlow + 8; k <= zhigh - 8; k+=2)
+ {
+ var rando = Math.random();
+ if(rando < 0.5)
+ {
+ var tree = new THREE.Mesh(treeGeo, treeColor);
+ var offset1 = Math.random()*2-1;
+ var offset2 = Math.random()*2-1;
+ tree.position.set(curves[i].getPoints(100)[j].x + offset1, -0.5, k + offset2);
+ tree.scale.set(0.75, 1.0, 0.75);
+ scene.add(tree);
+ }
+ }
+ }
+ }
+ }
+ });
+
+ objLoader.load('lamppost.obj', function(obj){
+
+ // LOOK: This function runs after the obj has finished loading
+ var lampGeo = obj.children[0].geometry;
+ var material = new THREE.MeshLambertMaterial( {color: 0x2c2b2b, side: THREE.DoubleSide} );
+
+ for(var i = -35; i < 40; i += 10)
+ {
+ var lamp1 = new THREE.Mesh(lampGeo, material);
+ lamp1.position.set(-61, 0.5, i+3);
+ lamp1.rotation.set(0, 3.1415/2.0, 0);
+ lamp1.scale.set(0.4, 0.6, 0.4);
+ scene.add(lamp1);
+
+ var lamp2 = new THREE.Mesh(lampGeo, material);
+ lamp2.position.set(-59, 0.5, i-3);
+ lamp2.rotation.set(0, -3.1415/2.0, 0);
+ lamp2.scale.set(0.4, 0.6, 0.4);
+ scene.add(lamp2);
+
+ var lamp3 = new THREE.Mesh(lampGeo, material);
+ lamp3.position.set(59, 0.5, i+3);
+ lamp3.rotation.set(0, 3.1415/2.0, 0);
+ lamp3.scale.set(0.4, 0.6, 0.4);
+ scene.add(lamp3);
+
+ var lamp4 = new THREE.Mesh(lampGeo, material);
+ lamp4.position.set(61, 0.5, i-3);
+ lamp4.rotation.set(0, -3.1415/2.0, 0);
+ lamp4.scale.set(0.4, 0.6, 0.4);
+ scene.add(lamp4);
+ }
+
+ for(var i = 0; i < curves.length; i++)
+ {
+ for(var j = 1; j < 99; j += 8)
+ {
+ var lamp1 = new THREE.Mesh(lampGeo, material);
+ lamp1.position.set(curves[i].getPoints(100)[j].x, 0.5, curves[i].getPoints(100)[j].z + 1);
+ lamp1.rotation.set(0, 3.1415, 0);
+ lamp1.scale.set(0.4, 0.6, 0.4);
+ scene.add(lamp1);
+
+ var lamp2 = new THREE.Mesh(lampGeo, material);
+ lamp2.position.set(curves[i].getPoints(100)[j].x, 0.5, curves[i].getPoints(100)[j].z - 1);
+ lamp2.scale.set(0.4, 0.6, 0.4);
+ scene.add(lamp2);
+ }
+ }
+ });
+}
+
+function getMaterial()
+{
+ var roof;
+ var wall;
+ //all the colors that might be used for the house
+ var white = new THREE.Vector3(1.0, 1.0, 1.0);
+ var tan = new THREE.Vector3((220.0/255.0), (198.0/255.0), (165.0/255.0));
+ var blue = new THREE.Vector3((172.0/255.0), (210.0/255.0), (243.0/255.0));
+ var charcoal = new THREE.Vector3((88.0/255.0), (87.0/255.0), (86.0/255.0));
+ var grey = new THREE.Vector3((142.0/255.0), (142.0/255.0), (142.0/255.0));
+
+ var rando = Math.random();
+ if(rando < 0.6)
+ {
+ roof = charcoal;
+ }
+ else
+ {
+ roof = grey;
+ }
+
+ var rando2 = Math.random();
+ if(rando2 < 0.2)
+ {
+ wall = blue;
+ }
+ else if(rando2 < 0.6)
+ {
+ wall = white;
+ }
+ else
+ {
+ wall = tan;
+ }
+
+ var houseColor = new THREE.ShaderMaterial({
+ uniforms: {
+ roofColor: {value: roof},
+ wallColor: {value: wall},
+ },
+ //using my own shaders to create white pink gradient
+ vertexShader: require('./shaders/house-vert.glsl'),
+ fragmentShader: require('./shaders/house-frag.glsl')
+ });
+ return houseColor;
+}
+
+function doLsystem(lsystem, iterations, turtle, pos, rot, xax, zax) {
+ var result = lsystem.doIterations(iterations, pos, rot, new THREE.Vector3(2.0, 1.0, 1.0), getMaterial(), xax, zax, false);
+ turtle.renderSymbols(result);
+}
+
+// called on frame updates
+function onUpdate(framework) {
+}
+
+// when the scene is done initializing, it will call onLoad, then on frame updates, call onUpdate
+Framework.init(onLoad, onUpdate);
diff --git a/src/shaders/house-frag.glsl b/src/shaders/house-frag.glsl
new file mode 100644
index 00000000..17498757
--- /dev/null
+++ b/src/shaders/house-frag.glsl
@@ -0,0 +1,28 @@
+varying vec3 norm;
+varying vec3 pos;
+uniform vec3 roofColor;
+uniform vec3 wallColor;
+
+void main() {
+
+ vec3 basecolor;
+ float lambert;
+
+ //lambertian shading calculation
+ vec3 lightDir = pos - vec3(10.0, 30.0, 20.0);
+ if(abs(norm[1]) < 0.0001) //if the normal has no upward component, this vertex is not on the roof
+ {
+ basecolor = wallColor;
+ lambert = clamp(dot(normalize(norm), 1.0*normalize(lightDir)), 0.5, 1.0);
+ }
+ else
+ {
+ basecolor = roofColor;
+ lambert = clamp(dot(normalize(norm), -1.0*normalize(lightDir)), 0.5, 1.0);
+ }
+
+ vec3 color = lambert*basecolor;
+
+ gl_FragColor = vec4( color.rgb, 1.0 );
+
+}
\ No newline at end of file
diff --git a/src/shaders/house-vert.glsl b/src/shaders/house-vert.glsl
new file mode 100644
index 00000000..a007402d
--- /dev/null
+++ b/src/shaders/house-vert.glsl
@@ -0,0 +1,10 @@
+varying vec3 norm;
+varying vec3 pos;
+
+void main() {
+ //to be used in fragment shader
+ pos = position;
+ norm = normal;
+
+ gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
+}
\ No newline at end of file
diff --git a/src/turtle.js b/src/turtle.js
new file mode 100644
index 00000000..8bf57e75
--- /dev/null
+++ b/src/turtle.js
@@ -0,0 +1,131 @@
+const THREE = require('three')
+var OBJLoader = require('three-obj-loader');
+OBJLoader(THREE);
+
+var houseGeo;
+
+// A class used to encapsulate the state of a turtle at a given moment.
+// The Turtle class contains one TurtleState member variable.
+// You are free to add features to this state class,
+// such as color or whimiscality
+var TurtleState = function(pos, dir) {
+ return {
+ pos: new THREE.Vector3(pos.x, pos.y, pos.z),
+ dir: new THREE.Vector3(dir.x, dir.y, dir.z)
+ }
+}
+
+export default class Turtle {
+
+ constructor(scene, grammar) {
+ this.state = new TurtleState(new THREE.Vector3(0,-5,0), new THREE.Vector3(0,1,0));
+ this.scene = scene;
+ }
+
+ // Resets the turtle's position to the origin
+ // and its orientation to the Y axis
+ clear() {
+ this.state = new TurtleState(new THREE.Vector3(0,0,0), new THREE.Vector3(0,1,0));
+ }
+
+ // A function to help you debug your turtle functions
+ // by printing out the turtle's current state.
+ printState() {
+ console.log(this.state.pos)
+ console.log(this.state.dir)
+ }
+
+ // Rotate the turtle's _dir_ vector by each of the
+ // Euler angles indicated by the input.
+ rotateTurtle(x, y, z) {
+ var e = new THREE.Euler(
+ x * 3.14/180,
+ y * 3.14/180,
+ z * 3.14/180);
+ this.state.dir.applyEuler(e);
+ }
+
+ // Translate the turtle along the input vector.
+ // Does NOT change the turtle's _dir_ vector
+ moveTurtle(x, y, z) {
+ var new_vec = THREE.Vector3(x, y, z);
+ this.state.pos.add(new_vec);
+ };
+
+ // Translate the turtle along its _dir_ vector by the distance indicated
+ moveForward(dist) {
+ var newVec = this.state.dir.multiplyScalar(dist);
+ this.state.pos.add(newVec);
+ };
+
+ build(shapeSet, scene)
+ {
+ var objLoader = new THREE.OBJLoader();
+ objLoader.load('house.obj', function(obj){
+
+ // LOOK: This function runs after the obj has finished loading
+ houseGeo = obj.children[0].geometry;
+ var material = new THREE.MeshLambertMaterial( {color: 0xffffff, side: THREE.DoubleSide} );
+
+ var box = new THREE.BoxGeometry( 1, 1, 1 );
+
+ shapeSet.forEach(function(shape)
+ {
+ if(shape.symbol == 'F')
+ {
+ var chimney = new THREE.Mesh(box, shape.material);
+ chimney.position.set(shape.pos.x, shape.pos.y, shape.pos.z);
+ chimney.rotation.set(shape.rot.x, shape.rot.y, shape.rot.z);
+ chimney.scale.set(shape.scale.x, shape.scale.y, shape.scale.z);
+ chimney.castShadows = true;
+ chimney.receiveShadows = true;
+ scene.add(chimney);
+ }
+ else if(shape.symbol == 'G')
+ {
+ var mat;
+ var rando = Math.random();
+ if(rando < 0.2)
+ {
+ mat = new THREE.MeshBasicMaterial( {color: 0xc9c6c6, side: THREE.DoubleSide} );
+ }
+ else if(rando < 0.4)
+ {
+ mat = new THREE.MeshBasicMaterial( {color: 0x363636, side: THREE.DoubleSide} );
+ }
+ else if(rando < 0.6)
+ {
+ mat = new THREE.MeshBasicMaterial( {color: 0x8a2020, side: THREE.DoubleSide} );
+ }
+ else
+ {
+ mat = new THREE.MeshLambertMaterial( {color: 0x69411d, side: THREE.DoubleSide} );
+ }
+
+ var door = new THREE.Mesh(box, mat);
+ door.position.set(shape.pos.x, shape.pos.y, shape.pos.z);
+ door.rotation.set(shape.rot.x, shape.rot.y, shape.rot.z);
+ door.scale.set(shape.scale.x, shape.scale.y, shape.scale.z);
+ door.castShadows = true;
+ door.receiveShadows = true;
+ scene.add(door);
+ }
+ else
+ {
+ var house = new THREE.Mesh(houseGeo, shape.material);
+ house.position.set(shape.pos.x, shape.pos.y, shape.pos.z);
+ house.rotation.set(shape.rot.x, shape.rot.y, shape.rot.z);
+ house.scale.set(shape.scale.x, shape.scale.y, shape.scale.z);
+ house.castShadows = true;
+ house.receiveShadows = true;
+ scene.add(house);
+ }
+ });
+ });
+ }
+
+ // Invoke renderSymbol for every node in a linked list of grammar symbols.
+ renderSymbols(set) {
+ this.build(set, this.scene);
+ }
+}
\ No newline at end of file
diff --git a/tree.mb b/tree.mb
new file mode 100644
index 00000000..fbe40db7
Binary files /dev/null and b/tree.mb differ
diff --git a/tree.mtl b/tree.mtl
new file mode 100644
index 00000000..c89145d9
--- /dev/null
+++ b/tree.mtl
@@ -0,0 +1,6 @@
+newmtl initialShadingGroup
+illum 4
+Kd 0.50 0.50 0.50
+Ka 0.00 0.00 0.00
+Tf 1.00 1.00 1.00
+Ni 1.00
diff --git a/tree.obj b/tree.obj
new file mode 100644
index 00000000..24dbe345
--- /dev/null
+++ b/tree.obj
@@ -0,0 +1,419 @@
+# This file uses centimeters as units for non-parametric coordinates.
+
+mtllib tree.mtl
+g default
+v 0.475209 2.542344 -0.345260
+v 0.181514 2.542344 -0.558642
+v -0.181514 2.542344 -0.558642
+v -0.475209 2.542344 -0.345260
+v -0.587391 2.542344 0.000000
+v -0.475209 2.542344 0.345260
+v -0.181514 2.542344 0.558642
+v 0.181514 2.542344 0.558642
+v 0.475209 2.542344 0.345260
+v 0.587391 2.542344 0.000000
+v 0.000000 3.332618 0.000000
+v 0.722821 1.865380 -0.525160
+v 0.276093 1.865380 -0.849727
+v -0.276093 1.865380 -0.849727
+v -0.722821 1.865380 -0.525160
+v -0.893456 1.865380 0.000000
+v -0.722821 1.865380 0.525160
+v -0.276093 1.865380 0.849727
+v 0.276093 1.865380 0.849727
+v 0.722821 1.865380 0.525160
+v 0.893456 1.865380 0.000000
+v 0.000000 3.067432 0.000000
+v 1.019749 0.854032 -0.740891
+v 0.389509 0.854032 -1.198787
+v -0.389510 0.854032 -1.198787
+v -1.019749 0.854032 -0.740891
+v -1.260479 0.854032 0.000000
+v -1.019749 0.854032 0.740891
+v -0.389509 0.854032 1.198787
+v 0.389509 0.854032 1.198786
+v 1.019749 0.854032 0.740891
+v 1.260479 0.854032 0.000000
+v 0.000000 2.549875 0.000000
+v 0.209286 -0.796309 -0.152055
+v 0.079940 -0.796309 -0.246030
+v -0.079940 -0.796309 -0.246030
+v -0.209286 -0.796309 -0.152055
+v -0.258691 -0.796309 0.000000
+v -0.209286 -0.796309 0.152055
+v -0.079940 -0.796309 0.246030
+v 0.079940 -0.796309 0.246030
+v 0.209286 -0.796309 0.152055
+v 0.258691 -0.796309 0.000000
+v 0.209286 1.542197 -0.152055
+v 0.079940 1.542197 -0.246030
+v -0.079940 1.542197 -0.246030
+v -0.209286 1.542197 -0.152055
+v -0.258691 1.542197 0.000000
+v -0.209286 1.542197 0.152055
+v -0.079940 1.542197 0.246030
+v 0.079940 1.542197 0.246030
+v 0.209286 1.542197 0.152055
+v 0.258691 1.542197 0.000000
+v 0.000000 -0.796309 0.000000
+v 0.000000 1.542197 0.000000
+vt 0.702254 0.103054
+vt 0.577254 0.012236
+vt 0.422746 0.012236
+vt 0.297746 0.103054
+vt 0.250000 0.250000
+vt 0.297746 0.396946
+vt 0.422746 0.487764
+vt 0.577254 0.487764
+vt 0.702254 0.396946
+vt 0.750000 0.250000
+vt 0.250000 0.500000
+vt 0.300000 0.500000
+vt 0.350000 0.500000
+vt 0.400000 0.500000
+vt 0.450000 0.500000
+vt 0.500000 0.500000
+vt 0.550000 0.500000
+vt 0.600000 0.500000
+vt 0.650000 0.500000
+vt 0.700000 0.500000
+vt 0.750000 0.500000
+vt 0.500000 1.000000
+vt 0.702254 0.103054
+vt 0.750000 0.250000
+vt 0.702254 0.396946
+vt 0.577254 0.487764
+vt 0.422746 0.487764
+vt 0.297746 0.396946
+vt 0.250000 0.250000
+vt 0.297746 0.103054
+vt 0.422746 0.012236
+vt 0.577254 0.012236
+vt 0.250000 0.500000
+vt 0.300000 0.500000
+vt 0.500000 1.000000
+vt 0.350000 0.500000
+vt 0.400000 0.500000
+vt 0.450000 0.500000
+vt 0.500000 0.500000
+vt 0.550000 0.500000
+vt 0.600000 0.500000
+vt 0.650000 0.500000
+vt 0.700000 0.500000
+vt 0.750000 0.500000
+vt 0.702254 0.103054
+vt 0.750000 0.250000
+vt 0.702254 0.396946
+vt 0.577254 0.487764
+vt 0.422746 0.487764
+vt 0.297746 0.396946
+vt 0.250000 0.250000
+vt 0.297746 0.103054
+vt 0.422746 0.012236
+vt 0.577254 0.012236
+vt 0.250000 0.500000
+vt 0.300000 0.500000
+vt 0.500000 1.000000
+vt 0.350000 0.500000
+vt 0.400000 0.500000
+vt 0.450000 0.500000
+vt 0.500000 0.500000
+vt 0.550000 0.500000
+vt 0.600000 0.500000
+vt 0.650000 0.500000
+vt 0.700000 0.500000
+vt 0.750000 0.500000
+vt 0.375000 0.312500
+vt 0.400000 0.312500
+vt 0.400000 0.688440
+vt 0.375000 0.688440
+vt 0.425000 0.312500
+vt 0.425000 0.688440
+vt 0.450000 0.312500
+vt 0.450000 0.688440
+vt 0.475000 0.312500
+vt 0.475000 0.688440
+vt 0.500000 0.312500
+vt 0.500000 0.688440
+vt 0.525000 0.312500
+vt 0.525000 0.688440
+vt 0.550000 0.312500
+vt 0.550000 0.688440
+vt 0.575000 0.312500
+vt 0.575000 0.688440
+vt 0.600000 0.312500
+vt 0.600000 0.688440
+vt 0.625000 0.312500
+vt 0.625000 0.688440
+vt 0.548284 0.007647
+vt 0.626409 0.064409
+vt 0.500000 0.150000
+vt 0.451716 0.007647
+vt 0.373591 0.064409
+vt 0.343750 0.156250
+vt 0.373591 0.248091
+vt 0.451716 0.304853
+vt 0.548284 0.304853
+vt 0.626409 0.248091
+vt 0.656250 0.156250
+vt 0.626409 0.935591
+vt 0.548284 0.992353
+vt 0.500000 0.837500
+vt 0.451716 0.992353
+vt 0.373591 0.935591
+vt 0.343750 0.843750
+vt 0.373591 0.751909
+vt 0.451716 0.695147
+vt 0.548284 0.695147
+vt 0.626409 0.751909
+vt 0.656250 0.843750
+vn 0.000000 -1.000000 -0.000000
+vn 0.000000 -1.000000 -0.000000
+vn 0.000000 -1.000000 -0.000000
+vn 0.000000 -1.000000 -0.000000
+vn 0.000000 -1.000000 -0.000000
+vn 0.000000 -1.000000 -0.000000
+vn 0.000000 -1.000000 -0.000000
+vn 0.000000 -1.000000 -0.000000
+vn 0.000000 -1.000000 -0.000000
+vn 0.000000 -1.000000 -0.000000
+vn 0.479972 0.577236 -0.660625
+vn 0.479972 0.577236 -0.660625
+vn 0.479972 0.577236 -0.660625
+vn -0.000000 0.577236 -0.816577
+vn -0.000000 0.577236 -0.816577
+vn -0.000000 0.577236 -0.816577
+vn -0.479972 0.577236 -0.660625
+vn -0.479972 0.577236 -0.660625
+vn -0.479972 0.577236 -0.660625
+vn -0.776611 0.577236 -0.252336
+vn -0.776611 0.577236 -0.252336
+vn -0.776611 0.577236 -0.252336
+vn -0.776611 0.577236 0.252336
+vn -0.776611 0.577236 0.252336
+vn -0.776611 0.577236 0.252336
+vn -0.479972 0.577236 0.660625
+vn -0.479972 0.577236 0.660625
+vn -0.479972 0.577236 0.660625
+vn 0.000000 0.577236 0.816577
+vn 0.000000 0.577236 0.816577
+vn 0.000000 0.577236 0.816577
+vn 0.479972 0.577236 0.660625
+vn 0.479972 0.577236 0.660625
+vn 0.479972 0.577236 0.660625
+vn 0.776611 0.577236 0.252336
+vn 0.776611 0.577236 0.252336
+vn 0.776611 0.577236 0.252336
+vn 0.776611 0.577236 -0.252336
+vn 0.776611 0.577236 -0.252336
+vn 0.776611 0.577236 -0.252336
+vn 0.000000 -1.000000 0.000000
+vn 0.000000 -1.000000 0.000000
+vn 0.000000 -1.000000 0.000000
+vn 0.000000 -1.000000 0.000000
+vn 0.000000 -1.000000 0.000000
+vn 0.000000 -1.000000 0.000000
+vn 0.000000 -1.000000 0.000000
+vn 0.000000 -1.000000 0.000000
+vn 0.000000 -1.000000 0.000000
+vn 0.000000 -1.000000 0.000000
+vn 0.479972 0.577236 -0.660625
+vn 0.479972 0.577236 -0.660625
+vn 0.479972 0.577236 -0.660625
+vn -0.000000 0.577236 -0.816577
+vn -0.000000 0.577236 -0.816577
+vn -0.000000 0.577236 -0.816577
+vn -0.479972 0.577236 -0.660625
+vn -0.479972 0.577236 -0.660625
+vn -0.479972 0.577236 -0.660625
+vn -0.776611 0.577236 -0.252336
+vn -0.776611 0.577236 -0.252336
+vn -0.776611 0.577236 -0.252336
+vn -0.776611 0.577236 0.252336
+vn -0.776611 0.577236 0.252336
+vn -0.776611 0.577236 0.252336
+vn -0.479972 0.577236 0.660625
+vn -0.479972 0.577236 0.660625
+vn -0.479972 0.577236 0.660625
+vn 0.000000 0.577236 0.816577
+vn 0.000000 0.577236 0.816577
+vn 0.000000 0.577236 0.816577
+vn 0.479972 0.577236 0.660625
+vn 0.479972 0.577236 0.660625
+vn 0.479972 0.577236 0.660625
+vn 0.776611 0.577236 0.252336
+vn 0.776611 0.577236 0.252336
+vn 0.776611 0.577236 0.252336
+vn 0.776611 0.577236 -0.252336
+vn 0.776611 0.577236 -0.252336
+vn 0.776611 0.577236 -0.252336
+vn 0.000000 -1.000000 0.000000
+vn 0.000000 -1.000000 0.000000
+vn 0.000000 -1.000000 0.000000
+vn 0.000000 -1.000000 0.000000
+vn 0.000000 -1.000000 0.000000
+vn 0.000000 -1.000000 0.000000
+vn 0.000000 -1.000000 0.000000
+vn 0.000000 -1.000000 0.000000
+vn 0.000000 -1.000000 0.000000
+vn 0.000000 -1.000000 0.000000
+vn 0.479972 0.577236 -0.660625
+vn 0.479972 0.577236 -0.660625
+vn 0.479972 0.577236 -0.660625
+vn -0.000000 0.577236 -0.816577
+vn -0.000000 0.577236 -0.816577
+vn -0.000000 0.577236 -0.816577
+vn -0.479972 0.577236 -0.660625
+vn -0.479972 0.577236 -0.660625
+vn -0.479972 0.577236 -0.660625
+vn -0.776611 0.577236 -0.252336
+vn -0.776611 0.577236 -0.252336
+vn -0.776611 0.577236 -0.252336
+vn -0.776611 0.577236 0.252336
+vn -0.776611 0.577236 0.252336
+vn -0.776611 0.577236 0.252336
+vn -0.479972 0.577236 0.660625
+vn -0.479972 0.577236 0.660625
+vn -0.479972 0.577236 0.660625
+vn 0.000000 0.577236 0.816577
+vn 0.000000 0.577236 0.816577
+vn 0.000000 0.577236 0.816577
+vn 0.479972 0.577236 0.660625
+vn 0.479972 0.577236 0.660625
+vn 0.479972 0.577236 0.660625
+vn 0.776611 0.577236 0.252336
+vn 0.776611 0.577236 0.252336
+vn 0.776611 0.577236 0.252336
+vn 0.776611 0.577236 -0.252336
+vn 0.776611 0.577236 -0.252336
+vn 0.776611 0.577236 -0.252336
+vn 0.587785 0.000000 -0.809017
+vn 0.587785 0.000000 -0.809017
+vn 0.587785 0.000000 -0.809017
+vn 0.587785 0.000000 -0.809017
+vn -0.000000 0.000000 -1.000000
+vn -0.000000 0.000000 -1.000000
+vn -0.000000 0.000000 -1.000000
+vn -0.000000 0.000000 -1.000000
+vn -0.587785 0.000000 -0.809017
+vn -0.587785 0.000000 -0.809017
+vn -0.587785 0.000000 -0.809017
+vn -0.587785 0.000000 -0.809017
+vn -0.951057 0.000000 -0.309017
+vn -0.951057 0.000000 -0.309017
+vn -0.951057 0.000000 -0.309017
+vn -0.951057 0.000000 -0.309017
+vn -0.951057 0.000000 0.309017
+vn -0.951057 0.000000 0.309017
+vn -0.951057 0.000000 0.309017
+vn -0.951057 0.000000 0.309017
+vn -0.587785 0.000000 0.809017
+vn -0.587785 0.000000 0.809017
+vn -0.587785 0.000000 0.809017
+vn -0.587785 0.000000 0.809017
+vn 0.000000 0.000000 1.000000
+vn 0.000000 0.000000 1.000000
+vn 0.000000 0.000000 1.000000
+vn 0.000000 0.000000 1.000000
+vn 0.587785 0.000000 0.809017
+vn 0.587785 0.000000 0.809017
+vn 0.587785 0.000000 0.809017
+vn 0.587785 0.000000 0.809017
+vn 0.951057 0.000000 0.309017
+vn 0.951057 0.000000 0.309017
+vn 0.951057 0.000000 0.309017
+vn 0.951057 0.000000 0.309017
+vn 0.951057 0.000000 -0.309017
+vn 0.951057 0.000000 -0.309017
+vn 0.951057 0.000000 -0.309017
+vn 0.951057 0.000000 -0.309017
+vn 0.000000 -1.000000 0.000000
+vn 0.000000 -1.000000 0.000000
+vn 0.000000 -1.000000 -0.000000
+vn 0.000000 -1.000000 0.000000
+vn 0.000000 -1.000000 0.000000
+vn 0.000000 -1.000000 0.000000
+vn 0.000000 -1.000000 -0.000000
+vn 0.000000 -1.000000 -0.000000
+vn 0.000000 -1.000000 0.000000
+vn 0.000000 -1.000000 0.000000
+vn 0.000000 -1.000000 -0.000000
+vn 0.000000 1.000000 0.000001
+vn 0.000000 1.000000 -0.000000
+vn 0.000000 1.000000 0.000000
+vn 0.000000 1.000000 0.000000
+vn 0.000000 1.000000 0.000000
+vn 0.000000 1.000000 0.000000
+vn 0.000000 1.000000 0.000001
+vn 0.000000 1.000000 0.000001
+vn 0.000000 1.000000 0.000000
+vn 0.000000 1.000000 0.000000
+vn 0.000000 1.000000 0.000001
+s off
+g pCone4
+usemtl initialShadingGroup
+f 1/1/1 10/10/2 9/9/3 8/8/4 7/7/5 6/6/6 5/5/7 4/4/8 3/3/9 2/2/10
+f 1/11/11 2/12/12 11/22/13
+f 2/12/14 3/13/15 11/22/16
+f 3/13/17 4/14/18 11/22/19
+f 4/14/20 5/15/21 11/22/22
+f 5/15/23 6/16/24 11/22/25
+f 6/16/26 7/17/27 11/22/28
+f 7/17/29 8/18/30 11/22/31
+f 8/18/32 9/19/33 11/22/34
+f 9/19/35 10/20/36 11/22/37
+f 10/20/38 1/21/39 11/22/40
+f 12/23/41 21/24/42 20/25/43 19/26/44 18/27/45 17/28/46 16/29/47 15/30/48 14/31/49 13/32/50
+f 12/33/51 13/34/52 22/35/53
+f 13/34/54 14/36/55 22/35/56
+f 14/36/57 15/37/58 22/35/59
+f 15/37/60 16/38/61 22/35/62
+f 16/38/63 17/39/64 22/35/65
+f 17/39/66 18/40/67 22/35/68
+f 18/40/69 19/41/70 22/35/71
+f 19/41/72 20/42/73 22/35/74
+f 20/42/75 21/43/76 22/35/77
+f 21/43/78 12/44/79 22/35/80
+f 23/45/81 32/46/82 31/47/83 30/48/84 29/49/85 28/50/86 27/51/87 26/52/88 25/53/89 24/54/90
+f 23/55/91 24/56/92 33/57/93
+f 24/56/94 25/58/95 33/57/96
+f 25/58/97 26/59/98 33/57/99
+f 26/59/100 27/60/101 33/57/102
+f 27/60/103 28/61/104 33/57/105
+f 28/61/106 29/62/107 33/57/108
+f 29/62/109 30/63/110 33/57/111
+f 30/63/112 31/64/113 33/57/114
+f 31/64/115 32/65/116 33/57/117
+f 32/65/118 23/66/119 33/57/120
+f 34/67/121 35/68/122 45/69/123 44/70/124
+f 35/68/125 36/71/126 46/72/127 45/69/128
+f 36/71/129 37/73/130 47/74/131 46/72/132
+f 37/73/133 38/75/134 48/76/135 47/74/136
+f 38/75/137 39/77/138 49/78/139 48/76/140
+f 39/77/141 40/79/142 50/80/143 49/78/144
+f 40/79/145 41/81/146 51/82/147 50/80/148
+f 41/81/149 42/83/150 52/84/151 51/82/152
+f 42/83/153 43/85/154 53/86/155 52/84/156
+f 43/85/157 34/87/158 44/88/159 53/86/160
+s 1
+f 35/89/161 34/90/162 54/91/163
+f 36/92/164 35/89/161 54/91/163
+f 37/93/165 36/92/164 54/91/163
+f 38/94/166 37/93/165 54/91/163
+f 39/95/167 38/94/166 54/91/163
+f 40/96/168 39/95/167 54/91/163
+f 41/97/169 40/96/168 54/91/163
+f 42/98/170 41/97/169 54/91/163
+f 43/99/171 42/98/170 54/91/163
+f 34/90/162 43/99/171 54/91/163
+s 2
+f 44/100/172 45/101/173 55/102/174
+f 45/101/173 46/103/175 55/102/174
+f 46/103/175 47/104/176 55/102/174
+f 47/104/176 48/105/177 55/102/174
+f 48/105/177 49/106/178 55/102/174
+f 49/106/178 50/107/179 55/102/174
+f 50/107/179 51/108/180 55/102/174
+f 51/108/180 52/109/181 55/102/174
+f 52/109/181 53/110/182 55/102/174
+f 53/110/182 44/100/172 55/102/174
diff --git a/webpack.config.js b/webpack.config.js
new file mode 100644
index 00000000..57dce485
--- /dev/null
+++ b/webpack.config.js
@@ -0,0 +1,28 @@
+const path = require('path');
+
+module.exports = {
+ entry: path.join(__dirname, "src/main"),
+ output: {
+ filename: "./bundle.js"
+ },
+ module: {
+ loaders: [
+ {
+ test: /\.js$/,
+ exclude: /(node_modules|bower_components)/,
+ loader: 'babel',
+ query: {
+ presets: ['es2015']
+ }
+ },
+ {
+ test: /\.glsl$/,
+ loader: "webpack-glsl"
+ },
+ ]
+ },
+ devtool: 'source-map',
+ devServer: {
+ port: 7000
+ }
+}
\ No newline at end of file