[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [802] branches/ivygen: some updates putting functions into place
Florian Meyer
florianfelix at web.de
Fri Jul 16 22:47:20 CEST 2010
Revision: 802
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-extensions&revision=802
Author: testscreenings
Date: 2010-07-16 22:47:20 +0200 (Fri, 16 Jul 2010)
Log Message:
-----------
some updates putting functions into place
Modified Paths:
--------------
branches/ivygen/ivy_algo.txt
branches/ivygen/ivy_functions.py
branches/ivygen/ivy_test.py
Modified: branches/ivygen/ivy_algo.txt
===================================================================
--- branches/ivygen/ivy_algo.txt 2010-07-16 20:17:49 UTC (rev 801)
+++ branches/ivygen/ivy_algo.txt 2010-07-16 20:47:20 UTC (rev 802)
@@ -101,7 +101,7 @@
get thre Vecors toaiff determine the direction of growing
primaryVector,
- randomVector (with abs slight upVector addition),
+ randomVector (with a slight upVector addition),
adhesionVector
compute the growvector
Modified: branches/ivygen/ivy_functions.py
===================================================================
--- branches/ivygen/ivy_functions.py 2010-07-16 20:17:49 UTC (rev 801)
+++ branches/ivygen/ivy_functions.py 2010-07-16 20:47:20 UTC (rev 802)
@@ -21,7 +21,31 @@
+def computeAdhesion(): #tmp, needs toaiff be filled :)
+ pass
-
\ No newline at end of file
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+def register():
+ pass
+
+def unregister():
+ pass
+
+if __name__ == "__main__":
+ register()
\ No newline at end of file
Modified: branches/ivygen/ivy_test.py
===================================================================
--- branches/ivygen/ivy_test.py 2010-07-16 20:17:49 UTC (rev 801)
+++ branches/ivygen/ivy_test.py 2010-07-16 20:47:20 UTC (rev 802)
@@ -39,7 +39,7 @@
class IvyNode(): #IvyNode Baseclass
position = mathutils.Vector()
- primaryDir = mathutils.Vector((0,0,0,5))
+ primaryVector = mathutils.Vector((0,0,0.25))
adhesionVector = mathutils.Vector()
smoothAdhesionVector = mathutils.Vector()
length = 0.0
@@ -73,19 +73,34 @@
def grow(self, props):
tmpRoot = IvyRoot() # create new RootNode
- #generate random Vector wit slight upvector
- randVector = (mathutils.Vector((random.random()-0.5, random.random()-0.5, random.random()-0.5)) +
+ #generate random Vector with slight upvector
+ randomVector = (mathutils.Vector((random.random()-0.5, random.random()-0.5, random.random()-0.5)) +
mathutils.Vector((0,0,0.2)))
+ #primaryVector
+ primaryVector = self.ivy_Roots[-1].primaryVector
+
+ #AdhesionVector
+ adhesionVector = computeAdhesion()
+
+ #compute the growVector
+ '''growVec = localIvySize * (primaryVector * primaryWeight *
+ randomVector * randomWeight *
+ adhesionVector * adhesionWeight)'''
+
#set position of new RootNode
- tmpRoot.position = (self.ivy_Roots[-1].position +
- randVector * props.ivyRandomWeight)
+ tmpRoot.position = (self.ivy_Roots[-1].position + #just using the randomVector for now
+ randomVector * props.ivyRandomWeight) #
# add to the chainNumber
if tmpRoot.chainNumber == 0 or tmpRoot.chainNumber == self.ivy_Roots[-1].chainNumber:
tmpRoot.chainNumber = self.ivy_Roots[-1].chainNumber + 1
#print(self.ivy_Roots[-1].chainNumber, self.ivy_Roots[-1].position)
+
+ #compute this Roots primaryVector
+ tmpRoot.primaryVector = (self.ivy_Roots[-1].primaryVector + (tmpRoot.position - self.ivy_Roots[-1].position)).normalize()
+
self.ivy_Roots.append(tmpRoot) #put into list of IvyNodes
More information about the Bf-extensions-cvs
mailing list