POV-Ray : Newsgroups : povray.general : Smooth curve with splines? Server Time
17 Nov 2024 11:12:26 EST (-0500)
  Smooth curve with splines? (Message 1 to 7 of 7)  
From: Tyler Eaves
Subject: Smooth curve with splines?
Date: 1 Apr 2003 22:26:33
Message: <3e8a5868@news.povray.org>
Hi gang!

Looking for a way to do a spline that follows the smoothest possible curve.
What do I mean by that? Heres an example.

spline{
        0, <0,0,-1>
        1, <0,0,0>
        2, <1,0,1>
        3, <2,0,0>
        4, <2,0,-1>
}

Should produce a perfect 180 curve, with straght lines entering and exiting.
The final goal of the project is to render a rollercoaster design, so smooth
curves are a must!


Post a reply to this message

From: Retsam
Subject: Re: Smooth curve with splines?
Date: 2 Apr 2003 12:10:14
Message: <web.3e8b18dc44f27f1a2a3ff2e70@news.povray.org>
Tyler Eaves wrote:
>
>Should produce a perfect 180 curve, with straght lines entering and exiting.
>The final goal of the project is to render a rollercoaster design, so smooth
>curves are a must!
>

Actually, that wouldn't be the "smoothest" curve.  Going from straight to a
sharp curve without any transition is not smooth.  Going from a curve to
straight without a transition is not smooth.  People in a roller coaster
would definitely feel like they were being jerked around at the
transitions.  Literally.  You would have an infinite 3rd derivative at the
transitions.  And in technical circles, the the third derivative is called
"jerk".

0th derivative: position
1st derivative: velocity
2nd derivative: acceleration
3rd derivative: jerk

So in order to avoid a huge jerk (yank, bump, whatever you want to call it),
you have to have matching 2nd derivatives at the transitions.  A straight
line has a value of 0 for its 2nd derivaive, and a 180 curve (I assumed you
meant semi-circle when you said "perfect" 180 curve) has a non-zero 2nd
derivative.

You can still have a straight line entering and exiting, but a truly smooth
transition would not use a semi-circle, but a funky spline curve that has
matching 2nd derivatives at the endpoints (0 in this example).

So perhaps to answer your question, if you want straight lines entering and
exiting, you wouldn't have those as part of the spline.  Just have the
straight lines entering and exiting.  Then you would need a spline that has
0 for the second derivatives at the ends of the curves (where they meet the
straigth lines).

I'm not good with splines, but if no one else can help you with that, I'd be
willing to give it a try.


Post a reply to this message

From: Mike Williams
Subject: Re: Smooth curve with splines?
Date: 2 Apr 2003 12:40:40
Message: <9kbDnAAZByi+EwV6@econym.demon.co.uk>
Wasn't it Retsam who wrote:
>Tyler Eaves wrote:
>>
>>Should produce a perfect 180 curve, with straght lines entering and exiting.
>>The final goal of the project is to render a rollercoaster design, so smooth
>>curves are a must!
>>
>
>Actually, that wouldn't be the "smoothest" curve.  Going from straight to a
>sharp curve without any transition is not smooth.  Going from a curve to
>straight without a transition is not smooth.  People in a roller coaster
>would definitely feel like they were being jerked around at the
>transitions.  Literally.  You would have an infinite 3rd derivative at the
>transitions.  And in technical circles, the the third derivative is called
>"jerk".
>
>0th derivative: position
>1st derivative: velocity
>2nd derivative: acceleration
>3rd derivative: jerk

Actually, for rollercoasters, the 4th derivative has a significant
effect on the tendency of the passengers to vomit. It's called "jounce".

I believe that Retsam's problem is that if he doesn't specify the spline
type, then it defaults to "linear_spline". He needs to specify one of
the other spline types.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: Tyler Eaves
Subject: Re: Smooth curve with splines?
Date: 2 Apr 2003 13:21:36
Message: <3e8b2a30@news.povray.org>
Mike Williams wrote:

> Wasn't it Retsam who wrote:
>>Tyler Eaves wrote:
>>>
>>>Should produce a perfect 180 curve, with straght lines entering and
>>>exiting. The final goal of the project is to render a rollercoaster
>>>design, so smooth curves are a must!
>>>
>>
>>Actually, that wouldn't be the "smoothest" curve.  Going from straight to
>>a
>>sharp curve without any transition is not smooth.  Going from a curve to
>>straight without a transition is not smooth.  People in a roller coaster
>>would definitely feel like they were being jerked around at the
>>transitions.  Literally.  You would have an infinite 3rd derivative at the
>>transitions.  And in technical circles, the the third derivative is called
>>"jerk".
>>
>>0th derivative: position
>>1st derivative: velocity
>>2nd derivative: acceleration
>>3rd derivative: jerk
> 
> Actually, for rollercoasters, the 4th derivative has a significant
> effect on the tendency of the passengers to vomit. It's called "jounce".
> 
> I believe that Retsam's problem is that if he doesn't specify the spline
> type, then it defaults to "linear_spline". He needs to specify one of
> the other spline types.
> 

No I just didn't give a spline type because I didn't want to imply which one
I was using. Perhaps I was misleading by saying smooth. What I mean was
more constant radius. The ride style I'm looking to emulate are the older
style steel coasters. The manufacuters at the time were limited to constant
radius curves, such as in the following picture:

http://rcdb.com/installationgallery224.htm?Picture=2

The train enters the boomerang element, each half of which is made up of
three seperate curves, the half corkscrew, the first 90 degrees of the half
loop, then the bottom. Three distinct radii. I could kinda get there with a
natural spline with addiontal points, but for instance in the hypothetical
curve I mentioned above, you get a small 's' shape at the entrance and
exit, definatly NOT smooth, and definatly WEIRD!


Post a reply to this message

From: Tor Olav Kristensen
Subject: Re: Smooth curve with splines?
Date: 2 Apr 2003 20:31:14
Message: <Xns9352241A15D07torolavkhotmailcom@204.213.191.226>
Tyler Eaves <tyl### [at] hotpopcom> wrote in news:3e8b2a30@news.povray.org:

... 
> No I just didn't give a spline type because I didn't want to imply
> which one I was using. Perhaps I was misleading by saying smooth. What
> I mean was more constant radius. The ride style I'm looking to emulate
> are the older style steel coasters. The manufacuters at the time were
> limited to constant radius curves, such as in the following picture:
> 
> http://rcdb.com/installationgallery224.htm?Picture=2
> 
> The train enters the boomerang element, each half of which is made up
> of three seperate curves, the half corkscrew, the first 90 degrees of
> the half loop, then the bottom. Three distinct radii. I could kinda
> get there with a natural spline with addiontal points, but for
> instance in the hypothetical curve I mentioned above, you get a small
> 's' shape at the entrance and exit, definatly NOT smooth, and
> definatly WEIRD! 

You will need rational splines in order to obtain
perfect circle segments for your track. And AFAIK
the spline types implemented in POV-Ray does not
currently include rational splines. But it can be
implemented with macros in scripts.

If you can tolerate some small errors, then you can
"string" together many smaller splines segments to
form a circle segment.

I once mad a kind of rollercoaster like track by
splicing together several lathe "segments".

To see an image of this, look for my post:

"Twisted Lathe (35 KB)"
3. June 2000 in povray.binaries.images
 
http://news.povray.org/povray.binaries.images/12302/


This post may also be of interest:

http://news.povray.org/povray.binaries.images/14118/

"Joining cylinders smootly (10KB)"
3. July 2001 in povray.binaries.images


Tor Olav


Post a reply to this message

From: Retsam
Subject: Re: Smooth curve with splines?
Date: 4 Apr 2003 21:10:04
Message: <web.3e8e3a5f44f27f1a34dff4bb0@news.povray.org>
Mike Williams wrote:

>>0th derivative: position
>>1st derivative: velocity
>>2nd derivative: acceleration
>>3rd derivative: jerk
>
>Actually, for rollercoasters, the 4th derivative has a significant
>effect on the tendency of the passengers to vomit. It's called "jounce".

Neat.  I hadn't heard of an official name for the 4th derivative yet.  Even
though all they teach in college is position, velocity, and acceleration,
there are quite a few indistries where jerk is just as important as the
other three.  I find it curious that it isn't mentioned more often.

But from what little I've read on higher order derivatives, few industries
have guidelines/tolerances on 4th derivatives.  The space/aeronautics
industry is one.  I hadn't thought about it much, but I suppose the
roller-coaster industry might be another.

Do you have more info, perhaps a website, about "jounce" and it's relevance
to roller coasters, aeronautics, etc.?


Post a reply to this message

From: Mike Williams
Subject: Re: Smooth curve with splines?
Date: 5 Apr 2003 01:01:48
Message: <5xcSSBABFnj+EwM5@econym.demon.co.uk>
Wasn't it Retsam who wrote:
>Mike Williams wrote:
>
>>>0th derivative: position
>>>1st derivative: velocity
>>>2nd derivative: acceleration
>>>3rd derivative: jerk
>>
>>Actually, for rollercoasters, the 4th derivative has a significant
>>effect on the tendency of the passengers to vomit. It's called "jounce".
>
>Neat.  I hadn't heard of an official name for the 4th derivative yet.  Even
>though all they teach in college is position, velocity, and acceleration,
>there are quite a few indistries where jerk is just as important as the
>other three.  I find it curious that it isn't mentioned more often.
>
>But from what little I've read on higher order derivatives, few industries
>have guidelines/tolerances on 4th derivatives.  The space/aeronautics
>industry is one.  I hadn't thought about it much, but I suppose the
>roller-coaster industry might be another.
>
>Do you have more info, perhaps a website, about "jounce" and it's relevance
>to roller coasters, aeronautics, etc.?

I only know of it from the Open University TV program (MST121: Using
Mathematics "Programme 03: Designer Rides - The Jerk and the Jounce")
first broadcast on 8 July 1997, most recently broadcast on 18 January
2000.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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