POV-Ray : Newsgroups : povray.general : How would I do this? : Re: How would I do this? Server Time
3 Aug 2024 08:12:22 EDT (-0400)
  Re: How would I do this?  
From: Tim Nikias v2 0
Date: 24 Mar 2004 15:02:14
Message: <4061e946$1@news.povray.org>
> Here's the setup. Imagine a spline describing a 3D curve with undulations,
> rather like, say, a roller coaster track. (Indeed, that is exactly what I
> intend to do with it.) I want to be able to translate a point relative to
> the origin 'along' the spline, so that basically the Z-axis at the origin
> would point along the tangent of the spine at the point. Now the tricky
> part. I want to *twist* the spline, with a another 1d spline that
> represents the twist in degrees at any given point.

Judging from the image and the other posts in this thread, you're having a
simliar problem like I had with my original tunnel-concept. When you just
want to calculate an outward vector at a given position, a straight forward
approach can introduce jumps in the calculations. In my case, the rotation
would jump back and forth for the right axis when the outward vector would
point towards a certain direction.

What I did (after Rune mentioned it) was to adjust the outward vector
progressively. You'll be running from one end to the other anyway, so
there's no loss in doing that. Then, all you need to do is judge by the
change in the heading from one interval to the next, how to affect the
outward vector.

Another approach would be, if you're using two splines anyways, why not make
one spline the path, and the other the up- or down-path? The rails' bottom
could always point towards a point on the other spline, and your problems
are solved. If you then want to introduce twists, just begin at a certain
point on the spline to rotate the objects/nodes/whatever about their axis
until you've come back to either 0 or 360 degrees, after which the twist
ends.

-- 
"Tim Nikias v2.0"
Homepage: <http://www.nolights.de>
Email: tim.nikias (@) nolights.de


Post a reply to this message

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