Math Is Fun Forum

  Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °

You are not logged in.

#2 Re: Help Me ! » Following the orientation of a path » 2006-08-08 23:23:45

p.x := round((h1 * p1.x) + (h2 * p2.x) + (h3 * t1.x) + (h4 * t2.x));
p.y := round((h1 * p1.y) + (h2 * p2.y) + (h3 * t1.y) + (h4 * t2.y));

This is what you actually drawing a point derived from x,y coords of p1,t1,t2,p2  and then next set starting from last point p2 t3 t4 p3

#3 Re: Help Me ! » Following the orientation of a path » 2006-08-08 23:15:48

Once again thank you for your answer. Yes, that it. You have a number of start/end points and start/end tangents and then you produce a 2D curve (that was the initial set of x,y points coords I was talking about)

#4 Re: Help Me ! » Following the orientation of a path » 2006-08-08 22:55:59

http://en.wikipedia.org/wiki/Cubic_Hermite_spline

#5 Re: Help Me ! » Following the orientation of a path » 2006-08-08 22:48:27

Actually, I am bit confused by the derivative formula you have mentioned.
This is what I was doing but I am NOT satisfied with the results I need more accuracy

dx := p1.x - p0.x;
dy := p1.y - p0.y;
theta := 180 - 180/pi * arctan2(dy,dx);

Then this theta angle is used to rotate the points of the circle accordinly on the Z axis in order to follow the path.
The problem is that I get some strange rotation values throughout the path.

I am trying to produce a circle to extrude along a spline in 3D space

#6 Re: Help Me ! » Following the orientation of a path » 2006-08-08 22:31:52

Thank you for your answer. This is the polynomial I am using.

0ce42119aa1d269ec890b74c49fc322b.png

It sounds like you want your object to be facing in the direction of the tangent to your curve.

up That's it

#7 Help Me ! » Following the orientation of a path » 2006-08-08 20:48:44

akoutsou
Replies: 12

Hi, all

I have a set of x,y points that define a curve (path) that was delivered by a Hermite polynomial.

Anyway, I need to find the rotation angle for each x,y point so that if an arrow moves along
this curve it will always point to the direction of the curve.

Here is a flash animation of what I am trying to implement  (see the sprite rotates along path)
http://www.developingwebs.net/flash/orient.php 

Any ideas,

Cheers

Board footer

Powered by FluxBB