POV-Ray : Newsgroups : povray.advanced-users : How to calculate Banking of Bezier-Splines...? : Re: How to calculate Banking of Bezier-Splines...? Server Time
29 Jul 2024 20:27:19 EDT (-0400)
  Re: How to calculate Banking of Bezier-Splines...?  
From: Christopher James Huff
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

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