# Moving an arrow over Bezier curve

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

## 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 on other sites
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 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 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 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 on other sites

You could also use the derivative of your Bezier function if you got really ambitious :-D.

~SPH

• 18
• 11
• 20
• 9
• 52
• ### Forum Statistics

• Total Topics
631397
• Total Posts
2999812
×