POV-Ray : Newsgroups : povray.general : pipe_spline and color : Re: pipe_spline and color Server Time
31 Oct 2024 19:58:51 EDT (-0400)
  Re: pipe_spline and color  
From: Le Forgeron
Date: 1 Dec 2015 07:18:42
Message: <565d9022$1@news.povray.org>
Le 28/11/2015 11:48, Alex a écrit :
> Hi everyone,
>
> Is anybody experienced with Chris Colefax' spline package? I am trying to
> generate a spline that changes its width and color along the spline position in
> a controlled manner. The spline will be much longer that thick, so using spheres
> seems like a bad option. Using "spline.mcr" and reading the tutorial I found
> that I can create a spline using tubes (which is much more efficient that
> spheres in my case) with the following syntax:
>
> #declare my_spline = create_spline (
>                               array[4] {start_position,  // 1st point
>                                         start_position + start_direction,
>                                         end_position - end_direction,
>                                         end_position},   // 2rnd point
>                                         create_bezier_spline)
>
> #macro spline_radius_function () sClock #end
> union { pipe_spline (my_spline, spline_radius (1)) pigment {rgb <1, 0, 0>} }
>
> ....with arbitrary parameters 'start_position', 'start_direction',
> 'end_position', and 'end_direction'. This gives me the right shape but a uniform
> color. I have been trying to vary the color (linearly) along the spline by
> multiplying the rgb value with 'sClock' or similar, but this is not accepted in
> the syntax. Anybody done this before or knows a solution?
>
> Many thanks in advance,
> Alex
>
>
Have you considered sphere_sweep ?
There is even a patched version of povray 3.7 with support of UV-mapping 
on sphere_sweep (despite the lack of documentation about that)

( http://wiki.povray.org/content/User:Le_Forgeron , master head on 
either listed repository )

Otherwise, without uv-mapping, you are to immerse the shape in the 
patterned pigment. for simple variation and simple shape, it might be 
possible to pattern the pigment.


Post a reply to this message

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