|
![](/i/fill.gif) |
stevenvh nous apporta ses lumieres en ce 2008/04/09 16:20:
> Hi Ricky,
> thanks for the explanation.
>
> I want to place a number of cuboids along a spline path, and rotate them
> according to the twisting of the path.
> I'll need the tangent as one of the cuboid's axes, but I also need the direction
> of curvature to know how the cuboid is to be rotated around the tangent axis.
> That's the background.
>
> I've been thinking :-)
> Finding the tangent axis is easy: that's r(t+1) - r(t-1), translated to r(t),
> right?
> Now, as long as r(t-1), r(t) and r(t+1) are not collinear, they define a circle
> whose center (c) is the center of curvature in r(t), right? So my normal vector
> is r(t) - c(t).
> Two points of attention:
> 1. r(t-1), r(t) and r(t+1) are collinear. In that case I would move c with r,
> i.e. c(t) = c(t-1) + r(t) - r(t-1).
> 2. if the three points are nearly collinear the problem may be ill-conditioned.
> I guess I could treat them as collinear if the radius of curvature becomes very
> large.
>
> So, what do you think?
>
> As for your OpenGL demo, I have no experience, but I'm interested. Is there a
> way on this forum to send you my e-mail address privately?
>
> Again thanks.
> Steven
>
>
>
>
An easy way: use the spline follow macro.
You define a spline, then call the macro with the spline name and a position as
parameters. It returns the coordinate at that point along with the orientation.
There is a sample scene showing it's working and application.
You'll find it in /scene/animation/splinefollow/splinefollow.pov
--
Alain
-------------------------------------------------
You know you've been raytracing too long when you prefer bald romatic partners,
because they're easier to model.
John VanSickle
Post a reply to this message
|
![](/i/fill.gif) |