POV-Ray : Newsgroups : povray.general : Smooth curve with splines? : Re: Smooth curve with splines? Server Time
4 Aug 2024 16:11:13 EDT (-0400)
  Re: Smooth curve with splines?  
From: Retsam
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

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