POV-Ray : Newsgroups : povray.advanced-users : How to calculate Banking of Bezier-Splines...? Server Time
1 Nov 2024 17:19:21 EDT (-0400)
  How to calculate Banking of Bezier-Splines...? (Message 1 to 10 of 14)  
Goto Latest 10 Messages Next 4 Messages >>>
From: Tim Nikias
Subject: How to calculate Banking of Bezier-Splines...?
Date: 23 Feb 2002 06:04:54
Message: <3C77775E.C685782E@gmx.de>
The problem is actually pretty simple. Using a simple
cubic bezier-spline as input (2 Nodes, 1 Direction for each
node = 4 Vectors), I want to calculate the outward
pointing direction of any point on the spline.

Think of the centrifugal-force when driving around a
corner. That's what I want to calculate.

I know that Chris Colefax has done a macro for
splines, but I can't see through his algorithms. Any
suggestions, reference PDF-Files, or whatever?

--
Tim Nikias
Homepage: http://www.digitaltwilight.de/no_lights/index.html


Post a reply to this message

From:
Subject: Re: How to calculate Banking of Bezier-Splines...?
Date: 23 Feb 2002 06:31:46
Message: <lrue7uo02l8bpo1vgdj7o3b5ld3it7biiu@4ax.com>
On Sat, 23 Feb 2002 12:05:02 +0100, Tim Nikias <tim### [at] gmxde> wrote:
> The problem is actually pretty simple. Using a simple
> cubic bezier-spline as input (2 Nodes, 1 Direction for each
> node = 4 Vectors), I want to calculate the outward
> pointing direction of any point on the spline.

With 4 vetors you have to calculate three equations x(t), y(t), z(t).
It is so called parametric curve. Direction of this curve for particular t
(tangent at this point) is IIRC value of derivative at this point. Look at
http://www.google.com/search?q=derivative+parametric+tangent

ABX


Post a reply to this message

From: Rune
Subject: Re: How to calculate Banking of Bezier-Splines...?
Date: 23 Feb 2002 06:59:34
Message: <3c778426@news.povray.org>
"Tim Nikias" wrote:
> The problem is actually pretty simple.

> Think of the centrifugal-force when driving around a
> corner. That's what I want to calculate.

Assuming you have a spline function Spline(T) where T is the input
interpolation value, I think you can do it like this:

(Spline(T)-(Spline(T+0.001)+Spline(T-0.001))/2)

Some ASCII art to illsustrate the code:

          *****P*****
     *****           ******
   *A          C           B*
 **                          **
*                              *

P is Spline(T), A is Spline(T-0.001), B is Spline(T+0.001), C is the average
of A and B. Then you just find the vector from C to P.

Is this what you need, or did I understand you wrong?

Rune
--
3D images and anims, include files, tutorials and more:
Rune's World:    http://rsj.mobilixnet.dk (updated Feb 16)
POV-Ray Users:   http://rsj.mobilixnet.dk/povrayusers/
POV-Ray Webring: http://webring.povray.co.uk


Post a reply to this message

From: Tim Nikias
Subject: Re: How to calculate Banking of Bezier-Splines...?
Date: 23 Feb 2002 07:21:03
Message: <3C778937.91C884D6@gmx.de>
You were right, that is what I am looking for.
But I already did come up with this method, there
was just one problem:

Bezier-Splines stay longer on the beginnings and
ends of a curve, and when using very small values
for the difference between the Ts, the three
positions may line up, resulting in weird centrifuges.

So I'm looking for possibilites of somehow detecting
which centrifuge there would be, if there would be a
more distinct curvature...


> Assuming you have a spline function Spline(T) where T is the input
> interpolation value, I think you can do it like this:
>
> (Spline(T)-(Spline(T+0.001)+Spline(T-0.001))/2)
>
> Some ASCII art to illsustrate the code:
>
>           *****P*****
>      *****           ******
>    *A          C           B*
>  **                          **
> *                              *
>
> P is Spline(T), A is Spline(T-0.001), B is Spline(T+0.001), C is the average
> of A and B. Then you just find the vector from C to P.
>

--
Tim Nikias
Homepage: http://www.digitaltwilight.de/no_lights/index.html


Post a reply to this message

From: Tim Nikias
Subject: Re: How to calculate Banking of Bezier-Splines...?
Date: 23 Feb 2002 07:24:04
Message: <3C7789EC.8C504189@gmx.de>
The problem is, I don't need the tangent (I was able
to figure that out, still, thanks for the reply). I need
to find the centrifugal-force, and I don't know if
tangents actually help me there...


--
Tim Nikias
Homepage: http://www.digitaltwilight.de/no_lights/index.html


Post a reply to this message

From: Rune
Subject: Re: How to calculate Banking of Bezier-Splines...?
Date: 23 Feb 2002 07:40:05
Message: <3c778da5@news.povray.org>
"Tim Nikias" wrote:
> Bezier-Splines stay longer on the beginnings and
> ends of a curve

I'm not sure what you mean by "stay longer".

> and when using very small values for the difference
> between the Ts, the three positions may line up,
> resulting in weird centrifuges.

I don't understand. If the three points line up it's either because there's
no centrifugal force at that point or because you're using so small
differences in T values that POV-Ray don't give you precise enough results.
Can't you just use larger differences in T values?

Rune
--
3D images and anims, include files, tutorials and more:
Rune's World:    http://rsj.mobilixnet.dk (updated Feb 16)
POV-Ray Users:   http://rsj.mobilixnet.dk/povrayusers/
POV-Ray Webring: http://webring.povray.co.uk


Post a reply to this message

From: Tim Nikias
Subject: Re: How to calculate Banking of Bezier-Splines...?
Date: 23 Feb 2002 09:34:39
Message: <3C77A883.A442B0E3@gmx.de>
>
> I'm not sure what you mean by "stay longer".
>

If you place spheres on a bezier-spline (just an example),
they will clutter up on beginnings and ending of a section.
Each section is defined by the already mentioned 2 Nodes
and their 2 directions. When using tiny T amounts, the
calculated positions may be very close to each other,
resulting in no centrifugal force.
It's like looking at a millimeter of a 100 meter curve...

>
> I don't understand. If the three points line up it's either because there's
> no centrifugal force at that point or because you're using so small
> differences in T values that POV-Ray don't give you precise enough results.
> Can't you just use larger differences in T values?
>

In general, a section has some sort of curvature, and I would
like to use some general sort of the centrifugal force.

Its not very easy to explain...

--
Tim Nikias
Homepage: http://www.digitaltwilight.de/no_lights/index.html


Post a reply to this message

From: Rune
Subject: Re: How to calculate Banking of Bezier-Splines...?
Date: 23 Feb 2002 10:26:00
Message: <3c77b488@news.povray.org>
"Tim Nikias" wrote:
> If you place spheres on a bezier-spline (just anexample),
> they will clutter up on beginnings and ending of a section.

That really depends on the lengths of the tangents (the two direction
vectors). The way I usually use bezier splines, the spheres are not
cluttered up around the ends. And thinking about it, when they *do* clutter
up around the ends due to short tangents, it's actually because the
curvature is higher near the ends... The curved parts usually have denser
spheres in general.

> It's like looking at a millimeter of a 100 meter curve...

As I said, why not use bigger differences in T values?

> In general, a section has some sort of curvature, and I would
> like to use some general sort of the centrifugal force.

See above.

> Its not very easy to explain...

Hmm, apparently not... :(

Rune
--
3D images and anims, include files, tutorials and more:
Rune's World:    http://rsj.mobilixnet.dk (updated Feb 16)
POV-Ray Users:   http://rsj.mobilixnet.dk/povrayusers/
POV-Ray Webring: http://webring.povray.co.uk


Post a reply to this message

From: Christopher James Huff
Subject: Re: How to calculate Banking of Bezier-Splines...?
Date: 23 Feb 2002 10:52:38
Message: <chrishuff-5AD572.10522923022002@netplex.aussie.org>
In article <3C7789EC.8C504189@gmx.de>, Tim Nikias <tim### [at] gmxde> 
wrote:

> The problem is, I don't need the tangent (I was able
> to figure that out, still, thanks for the reply). I need
> to find the centrifugal-force, and I don't know if
> tangents actually help me there...

Find the tangent at the point, and the tangent a little distance ahead. 
The amount of force will be related to the angle between these tangents 
(normalize them, and the dot product will be the cosine of the angle) 
and the distance between the two points on the spline.
Find the angle first, if it is too small just don't bother with the 
force calculations.
A vector perpendicular to the direction of the force can be found by 
taking the cross product of the two tangents. You can then find the 
direction of force by getting the cross product of this vector with the 
first tangent.

-- 
Christopher James Huff <chr### [at] maccom>
POV-Ray TAG e-mail: chr### [at] tagpovrayorg
TAG web site: http://tag.povray.org/


Post a reply to this message

From: Tim Nikias
Subject: Re: How to calculate Banking of Bezier-Splines...?
Date: 23 Feb 2002 16:59:34
Message: <3C7810D0.3D0DECEF@gmx.de>
>
> ...

Very elaborate, thank you!

I don't want to calculate the actual force, but only the
centrifugal-vector. When thinking about your advice
with the cross-products etc, I'm wondering, if
I can be 100% sure, that the resulting vector
will be the centrifuge, or perhaps may be the
inverse (which would also be perpendicular)?

I'll try. Thanks for your help!

--
Tim Nikias
Homepage: http://www.digitaltwilight.de/no_lights/index.html


Post a reply to this message

Goto Latest 10 Messages Next 4 Messages >>>

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.