Author: Carlos Lopez <[email protected]>
Date: Sun Mar 20 17:15:23 2011 +0100
Use new smooth formulation. New one has first and second derivatives equal to
zero on both ends.
It approximates the old Homogeneous render when smoothness is 0.5, giving more
smooth result for 1.0
---
synfig-core/src/synfig/valuenode_wplist.cpp | 25 +++----------------------
1 files changed, 3 insertions(+), 22 deletions(-)
diff --git a/synfig-core/src/synfig/valuenode_wplist.cpp
b/synfig-core/src/synfig/valuenode_wplist.cpp
index 80e6563..4bbe76c 100644
--- a/synfig-core/src/synfig/valuenode_wplist.cpp
+++ b/synfig-core/src/synfig/valuenode_wplist.cpp
@@ -36,7 +36,6 @@
#include "general.h"
#include "exception.h"
#include "widthpoint.h"
-#include <ETL/hermite>
#include <vector>
#include <list>
@@ -130,13 +129,7 @@ synfig::widthpoint_interpolate(const WidthPoint& prev,
const WidthPoint& next, c
q=0.5;
else
q=(p-pp)/(np-pp);
- hermite<Vector> curve(
- Vector(pp, pw),
- Vector(np, nw),
- Vector(0.0,0.0),
- Vector(0.0,0.0)
- );
-
rw=(pw+(nw-pw)*q)*(1.0-smoothness)+curve(q)[1]*smoothness;
+
rw=pw+(nw-pw)*(q*(1.0-smoothness)+q*q*q*(10+q*(6*q-15))*smoothness);
}
else if(p < pp)
{
@@ -169,13 +162,7 @@ synfig::widthpoint_interpolate(const WidthPoint& prev,
const WidthPoint& next, c
if(np > p)
q=(p+1.0-pp)/(np+1.0-pp);
}
- hermite<Vector> curve(
- Vector(pp, pw),
- Vector(np, nw),
- Vector(0.0,0.0),
- Vector(0.0,0.0)
- );
- rw=(pw+(nw-pw)*q)*(1.0-smoothness)+curve(q)[1]*smoothness;
+
rw=pw+(nw-pw)*(q*(1.0-smoothness)+q*q*q*(10+q*(6*q-15))*smoothness);
}
else
if(p > np && p < pp)
@@ -189,13 +176,7 @@ synfig::widthpoint_interpolate(const WidthPoint& prev,
const WidthPoint& next, c
q=0.5;
else
q=(p-np)/(pp-np);
- hermite<Vector> curve(
- Vector(np, nw),
- Vector(pp, pw),
- Vector(0.0,0.0),
- Vector(0.0,0.0)
- );
- rw=(nw+(pw-nw)*q)*(1.0-smoothness)+curve(q)[1]*smoothness;
+
rw=nw+(pw-nw)*(q*(1.0-smoothness)+q*q*q*(10+q*(6*q-15))*smoothness);
}
return rw;
}
------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
Synfig-devl mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/synfig-devl