Skip to content

Commit

Permalink
fix for attractUp crumpling
Browse files Browse the repository at this point in the history
  • Loading branch information
abpy committed Apr 26, 2016
1 parent f7cca89 commit 720f312
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion add_curve_sapling_3/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,13 @@ def curveUp(attractUp, quat, curveRes):
tempVec = yAxis.copy()
tempVec.rotate(quat)
tempVec.normalize()
return attractUp*radians(declination(quat))*abs(tempVec.z)/curveRes
dec = radians(declination(quat))
curveUpAng = attractUp*dec*abs(tempVec.z)/curveRes
if (-dec + curveUpAng) < -pi:
curveUpAng = -pi + dec
if (dec - curveUpAng) < 0:
curveUpAng = dec
return curveUpAng

# Evaluate a bezier curve for the parameter 0<=t<=1 along its length
def evalBez(p1, h1, h2, p2, t):
Expand Down

0 comments on commit 720f312

Please sign in to comment.