Bezier-Hermite Hybrid

Started by
1 comment, last by xanin 19 years, 4 months ago
Wasnt sure if this should go in the graphics forum or here, but i decided it was more mathematical. Ok, So I've got this assignment for my graphics course. It was due the other day, so its pretty much academic now. The objective was to create a "Hermier" curve specified by 2 endpoints, p1 and p4, a parametric midpoint (at t=.5) p2, and it associated tangent r3. This provides the geometry vector G=[p1 p2 r3 p4] According to the asisgnment, the eq of the curve is given by: Q(t) = GMT where T = (uhm, hell, how to display a matrix best in a forum...) t^3 t^2 t 1 (4x1 matrix) First problem is to get the basis matrix, which I did, and got: M = -4 8 -5 1 4 -4 1 0 0 -4 4 0 -4 6 -2 0 now when I throw that all in to my calculator to get Q(t) it spits out the following: x=-2*p4x*t*(2*t^2-3*t+1)+4*t^3*(p2x-p1x)-4*t^2*(r3x+p2x-p1x)+t*(4*r3x+p2x-5*p1x)+p1x; y=p1y*(-4*t^3+8*t^2-5*t+1)-t*(4*(p4y-p2y)*t^2-2*(3*p4y-2*(r3y+p2y))*t+2*p4y-4*r3y-p2y); So i dutifully plug all that into my nifty little opengl program that should take in the 3 points, the vector and plot the outcome. Thats sounds all well and good, but for the points and vectors im putting in, Im not getting naything like what I expected out. I can provide examples of the output if you'd like. If anyone wants to work this out and tell me where I went wrong, please feel free, I'd apreciate it immensely.
Advertisement
Hi,
here is a good website:
Hermite Curve Interpolation

If your still having problems, let us know what your input values are.
Quote:Original post by aboeing
Hi,
here is a good website:
Hermite Curve Interpolation

If your still having problems, let us know what your input values are.


Ive actually looked at that site a bit, thnx though.

As it turns out i had made a slight error and gotten the columns in an incorrect order in the matrix i used to derive the basis matrix, this wa spointed out to me by a friend in the class. So, with that fixed, everything appears to be correct now.

This topic is closed to new replies.

Advertisement