POV-Ray : Newsgroups : povray.binaries.images : Sphere_sweep: gradient along a curve. : Re: Sphere_sweep: gradient along a curve. Server Time
30 Jul 2024 04:21:04 EDT (-0400)
  Re: Sphere_sweep: gradient along a curve.  
From: Robert McGregor
Date: 11 Feb 2014 08:50:00
Message: <web.52fa29ffa5ee4db891114470@news.povray.org>
Le_Forgeron <lef### [at] freefr> wrote:
> Le 11/02/2014 00:14, Robert McGregor a écrit :
>
> > If POV-Ray could auto-calculate UVs on sphere_sweeps at render time, that would
> > be the optimal solution to this... maybe a simple patch can fix it.
>
> Something like u being the "position" on the sphere_sweep and v being
> the circumference ?
> A few questions:
> * for u, what is the range ? 0 to 1 for the whole sphere_sweep, or 0 to
> n-1, n being the number of coordinates ?
> * for v, most complex: how to orient it (where is 0 ?)
>
Exactly: u = spline position, v = circumference

I think a normalized u over 0-1 range for the entire sweep would make texturing
more manageable, using something like:

sphere_sweep {
   ...
   texture { uv_mapping
      pigment {
         gradient u
         color_map { [0 rgb <1,0,0>][1 rgb <0,1,0>]] }
      }
   }
}

The starting position for v shouldn't matter as it's a seamless loop around the
circumference (like cylindrical mapping).

-------------------------------------------------
www.McGregorFineArt.com


Post a reply to this message

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