Hi there,
I’m trying to interpolate some points by using a HermiteCurve, but the output isn’t interpolated.
The way I use it is the following:
##
## create the curve
##
points = [...] # a list of points (Vec3)
curve = HermiteCurve()
for point in points:
curve.appendCv(4, point[0], point[1], point[2])
# HC_CUT = 1, HC_FREE = 2, HC_G1 = 3, or HC_SMOOTH = 4
# the 1st parameter '4' is for HC_SMOOTH
# because the constant HC_SMOOTH seems not to be defined in python
curve.recompute()
##
## draw the curve
##
resolution = 100
point = Vec3(0,0,0)
length = curve.getMaxT()
for i in xrange(0,resolution):
curve.getPoint(i*(length/resolution), point)
# draw the point into a bitmap...
I also tried to use a NurbsCurve. This interpolated the points very well, but I have to use a curve that goes through the points, which Nurbs actually doesn’t.
In the manual there is not much information about the HermiteCurve. Has anybody worked with it who could tell me how to get it interpolating points or what I’m doing wrong?
Thanks in advance,
Carsten