Sign in to follow this  
xanin

Bezier-Hermite Hybrid

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this