POV-Ray : Newsgroups : povray.advanced-users : How to calculate Banking of Bezier-Splines...? Server Time
29 Jul 2024 18:26:46 EDT (-0400)
  How to calculate Banking of Bezier-Splines...? (Message 11 to 14 of 14)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Tim Nikias
Subject: Re: How to calculate Banking of Bezier-Splines...?
Date: 23 Feb 2002 17:01:45
Message: <3C781153.ACCF0564@gmx.de>
Christopher Hames Huff has replied and given me
some mathematical insight with cross-products
and dot-products. I'll guess going from there, I'll
find a solution to what I am heading for. Your
replies are still thanked for. Its worth noting that
you actually spend time on others problems...

Thank you very much!

--
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 18:51:30
Message: <3c782b02@news.povray.org>
"Tim Nikias" wrote:
> Christopher Hames Huff has replied and given me
> some mathematical insight with cross-products
> and dot-products. I'll guess going from there, I'll
> find a solution to what I am heading for.

I didn't know that was your problem. :)

It's worth noting that the solution I suggested still is valid. Chris Huff
suggested a method involving angles and checking the spline at four
different places (in order to get two tangents), while my method doesn't
involve angles (or dot products) and needs only the spline tested at three
places.

But you basically get the same thing. It sounds like your problem was that
you wanted the centrifugal force vector calculated to be perpendicular to
the tangent of the spline at that point. Using my own example as basis this
is very easy as you already have the tangent, which is (B-A). Now you just
need to adjust the vector (P-C) so that it's perpendicular to the vector
(B-A). POV-Ray 3.5 has a macro to do that, called VPerp_Adjust. The
VPerp_Adjust macro do automatically the things with vcross that Chris Huff
talked about. You can read about the macro in the documentation.

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 22:09:46
Message: <chrishuff-12FCA8.22093623022002@netplex.aussie.org>
In article <3c782b02@news.povray.org>,
 "Rune" <run### [at] mobilixnetdk> wrote:

> It's worth noting that the solution I suggested still is valid. Chris Huff
> suggested a method involving angles and checking the spline at four
> different places (in order to get two tangents), while my method doesn't
> involve angles (or dot products) and needs only the spline tested at three
> places.

Actually, my method only needs 3 points tested...I was just trying to 
simplify my explanation when I said 2 tangents. It would probably work 
better with 4 though, less opportunity for precision error. The basic 
idea is to look ahead to two points to estimate the direction and amount 
of curvature of the spline, find the normal of the plane the spline is 
in at that point (the three points form a triangle), and get a vector 
perpendicular to that, which will be perpendicular to the spline and in 
the "outward" direction of curvature.


> But you basically get the same thing. It sounds like your problem was that
> you wanted the centrifugal force vector calculated to be perpendicular to
> the tangent of the spline at that point. Using my own example as basis this
> is very easy as you already have the tangent, which is (B-A). Now you just
> need to adjust the vector (P-C) so that it's perpendicular to the vector
> (B-A). POV-Ray 3.5 has a macro to do that, called VPerp_Adjust. The
> VPerp_Adjust macro do automatically the things with vcross that Chris Huff
> talked about. You can read about the macro in the documentation.

I have a sneaking suspicion our two solutions are mathematically the 
same, just arrived at differently...
VPerp_Adjust() is defined as:
vnormalize(vcross(vcross(Axis, V), Axis))
Which is basically what I wrote. Ah, well...

-- 
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: Rune
Subject: Re: How to calculate Banking of Bezier-Splines...?
Date: 24 Feb 2002 05:18:44
Message: <3c78be04@news.povray.org>
"Christopher James Huff" wrote:
> The basic idea is to look ahead to two points to
> estimate the direction and amount of curvature of
> the spline

I think it's better if the point in question is the middle one of the three
points rather than the back one.

> I have a sneaking suspicion our two solutions are
> mathematically the same, just arrived at differently...

The same, or very close.

> VPerp_Adjust() is defined as:
> vnormalize(vcross(vcross(Axis, V), Axis))
> Which is basically what I wrote.

My point exactly. I use that macro a lot by the way - it's really useful. :)

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

<<< Previous 10 Messages Goto Initial 10 Messages

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