POV-Ray : Newsgroups : povray.binaries.images : Tyre macro preview + question : Re: Tyre macro preview + question Server Time
2 Oct 2024 02:22:08 EDT (-0400)
  Re: Tyre macro preview + question  
From: David Wilkinson
Date: 19 Jun 2000 18:09:32
Message: <gf6tkskukcv5crv57edgpbj1tpfa72c3f4@4ax.com>
On Mon, 19 Jun 2000 18:03:11 +0000, Francois Dispot <woz### [at] club-internetfr>
wrote:

>Peter Popov wrote:
>
>> Just out of curiosity, isn't the formula in the source code of POV? If
>> you can't find it, can you use trace() ? Lastly, why don't you use a
>> bezier spline lathe? At least you won't be wondering where its
>> tangents are pointing.
>
>Excellent suggestion. The most obvious way to do what I want is a Bezier
>spline... if only I happenned to find the syntax somewhere in the docs!

The information is there under Lathe, but it is very sparse.
 Bezier splines are actually very easy to use.  For each span (pair of points)
you have to give;
<point1>,< control point1>, <controlpoint2>,<point2>
where the control points are the end points of the tangent vectors.  The curve
will be tangent to the vector at its associated point, and the length of the
vector determines the curvature at its associated point.

e.g. this makes a pretty good sphere;
  
lathe {
  bezier_spline
 12,
  <0,1>, <4/3*(sqrt(2)-1), 1>, <1,4/3*(sqrt(2)-1)>, <1,0>, // 1st span
 <1, 0>, <1,-4/3*(sqrt(2)-1)>,  <4/3*(sqrt(2)-1), -1>, <0,-1>, // 2nd span
<0,-1>,<0,0>,<0,0>,<0,1> // 3rd span
  pigment {Red}
 }

(the 4/3*sqrt(2)-1 term just gives a length of vector that makes the bezier
cubic approximate to a circular arc)

David
dav### [at] hamiltonitecom
http://www.hamiltonite.com/


Post a reply to this message

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