• Advertisement
Sign in to follow this  

Moving an arrow over Bezier curve

This topic is 4841 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello people, I am trying to learn few things in 3d(opengl). Ammm and i am stuck .....ahhh. Okay i have a bezier curve(circular curve) and an arrow. Now i want this arrow to follow the path on the curve. Though i have been able to move the arrow on the curve but it constantly points in one direction it should point in the direction in which it is moving along the curve and i dont know how to do this can some one please help. I have posted the project on http://gamearena.freeserverhost.com download the Project1 from the website. The arrow moves from the left and right arrow keys.......Hope to hear from you guys soon.

Share this post


Link to post
Share on other sites
Advertisement
Well, if you are placing the arrow at some value of t along the curve, why not also calculate t+(small number), and make it point towards that?

Share this post


Link to post
Share on other sites
Hmm can you tell me how to do that i am new to opengl. I have shared the project on http://gamearena.freeserverhost.com download the Project1 from the website. The arrow moves from the left and right arrow keys.......

Share this post


Link to post
Share on other sites
This isn't anything OpenGL.
I assume you are currently doing something like:

x,y = bezierCurve(time)

So you can just do

nx,ny = bezierCurve(time + 0.1)

And have the arrow be positioned at x,y (like normal) but pointing at nx,ny.

Share this post


Link to post
Share on other sites
You can do it to ways: a) Get the normal of the Bezier curve analytically or b)Keep the last evaluated coordinate, and create a vector between the current and the last coordinate. Both will give you an orientation to align the arrow by.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement