POV-Ray : Newsgroups : povray.general : pipe_spline and color : pipe_spline and color Server Time
31 May 2024 22:31:01 EDT (-0400)
  pipe_spline and color  
From: Alex
Date: 28 Nov 2015 05:50:00
Message: <web.565986946f420569f6cc3ced0@news.povray.org>
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


Post a reply to this message

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