Saturday, December 7, 2013

Generative Art Final Journal

Saturday 16 - I worked on using Python inside Maya to determine whether or not a point (location of a boid) was inside or out side a volume defined by geometry. This would allow for me to shape the flock by applying a "field" that they "instinctively" would rather be inside.

      import maya.cmds as cmd
import maya.OpenMaya as om cmd.polySphere() cmd.rename("pSphere1", "globe")
def test_if_inside_mesh(point=(0.0, 0.0, 0.0), dir=(0.0, 0.0, 1.0)): sel = om.MSelectionList() dag = om.MDagPath()
#replace torus with arbitrary shape name sel.add("globe") sel.getDagPath(0,dag)
mesh = om.MFnMesh(dag)
point = om.MFloatPoint(*point) dir = om.MFloatVector(*dir) farray = om.MFloatPointArray()
mesh.allIntersections( point, dir, None, None, False, om.MSpace.kWorld, 10000, False, None, # replace none with a mesh look up accelerator if needed False, farray, None, None, None, None, None ) return farray.length()%2 == 1
#test print test_if_inside_mesh() print test_if_inside_mesh((1,0,0))

Sunday 17 - continued work on my flocking code. I spent a lot of time searching for a method to update the system inside Maya rather than coding it outside and interacting with an external program. This would not work as the amount of information that Maya was trying to process was too great. Hitting this roadblock I explored ideas of alternatives to the Bird as a Boid model. One of the designs had a flock of black and red pens hunting a white piece of paper eventually succeeding in "capturing it" but by this point it is crumpled, wrinkled, torn and no longer usable. I began working on a model for the pen and textured and rigged it. It has 3 points of articulation .
Wednesday 27 - I hit a road block on the flocking system and decided to proceed with working on creating a procedural environment. I started b looking at fractal designs. I came across fractal flowers and decided that that would be a good starting point due to the large amount of them.  Along the way I remembered the multitude of plants that use the Fibonacci spiral that we discussed in class. After some research I came up with the following basis for a single spiral
 
PI = 22/7 spirals = 6 limit_radius = 144 theta = 0 theta_increase = 15 fib_a = 0 fib_b = 1 fib_c = 0
for fib_a in range(0, 15): fib_c=fib_a+fib_b; fib_a=fib_b fib_b=fib_c
sphere_radius = fib_c r = fib_c * 3 x = r * math.cos(math.radians(theta)) z = r * math.sin(math.radians(theta)) y = r cmd.duplicate( name = 'base') #r = sphere_radius, h = -r/2, sx = 10, sy = 10) cmd.move(x, y, z) cmd.rotate(45, (-theta - 90) , 0) cmd.scale(sphere_radius/2, sphere_radius/2, sphere_radius/2) theta += theta_increase


The code was changed from this however the basis is there. name 'base' refers to the object that is being called recursively. This base curve is repeated and rotated by 45 degrees for a total of 8 spirals. This new object is defined as base.

Friday 29 - started running into memory issues again I am going to focus on perfecting the plant creation for the final. This memory issue I understand when the code is run to the 3 power it creates approximately 3 million polygons. This is usable however I need to run the code to 4th power to get the detail level that I want maybe more. I will try to create a normal map for a 1st power base that has within it greater levels of detail that I can use to supplement the additional polygon count.




Saturday 30 - Today I worked on choosing an appropriate texture for the color of the plant I am currently going with a tone modulated version of subsurface scattering
Sunday 1 Set the final Render up with depth of field to emulate a macroscopic

No comments:

Post a Comment