POV-Ray : Newsgroups : povray.newusers : A simple Sphere_Sweep question Server Time
29 Oct 2024 22:47:42 EDT (-0400)
  A simple Sphere_Sweep question (Message 1 to 3 of 3)  
From: tgl
Subject: A simple Sphere_Sweep question
Date: 29 Jul 2010 05:05:01
Message: <web.4c5143fd1cd3c254ee84c7590@news.povray.org>
Hello group
Could some understanding person out there please show
how they would code a sphere_sweep b_spline of a 180
degree circular arc into POV.
And...How would the above arc be coded as a sphere_
sweep natural_spline?
Thank you.


Post a reply to this message

From: clipka
Subject: Re: A simple Sphere_Sweep question
Date: 29 Jul 2010 07:36:35
Message: <4c5167c3$1@news.povray.org>
Am 29.07.2010 11:03, schrieb tgl:

> Could some understanding person out there please show
> how they would code a sphere_sweep b_spline of a 180
> degree circular arc into POV.
> And...How would the above arc be coded as a sphere_
> sweep natural_spline?

Both b_spline and natural_spline are actually cubic splines at their 
heart (with different approaches of parameterizing the spline via the 
control points). Unfortunately, unless I'm totally mistaken, cubic 
splines are incapable of representing circular arcs, so the best you can 
get is an approximation.


Post a reply to this message

From: Jim Charter
Subject: Re: A simple Sphere_Sweep question
Date: 31 Jul 2010 14:43:11
Message: <4c546ebf@news.povray.org>
tgl wrote:
> Hello group
> Could some understanding person out there please show
> how they would code a sphere_sweep b_spline of a 180
> degree circular arc into POV.
> And...How would the above arc be coded as a sphere_
> sweep natural_spline?
> Thank you.
> 
> 
camera {
   location  <0,0,-50>
   look_at   <0.0, 0.0,  0.0>
   right     x*image_width/image_height
}

// create a regular point light source
light_source {
   0*x                  // light's position (translated below)
   color rgb <1,1,1>    // light's color
   translate vrotate(<0,0,-100>,<60,60,0>)
}
sphere { 0, .5 pigment {rgb y}}
cylinder { <-30,0,0>,<30,0,0>,.25 pigment{rgb y}}

// create a curved tube object translating a sphere along a certain path
//object {
sphere_sweep {

   cubic_spline

   21,
   #local I=-1;#while(I<20)
     vrotate (<20,0,0>,<0,0,I*10>), .5
   #local I=I+1;#end

   pigment{rgb x}

}


Post a reply to this message

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