POV-Ray : Newsgroups : povray.general : request for pigment help : Re: request for pigment help Server Time
30 Jul 2024 16:21:57 EDT (-0400)
  Re: request for pigment help  
From: Alain
Date: 27 Oct 2008 11:01:10
Message: <4905d7b6$1@news.povray.org>
Leef_me nous illumina en ce 2008-10-26 22:03 -->
> "Bob Hughes" <omniverse charter net> wrote:

> Hi Guys,
> 
> So far, Bob got the idea of what I was looking for, but I still have one
> concern.
> 
> I want to control how many sections there are, it seems to be related to
> "radial frequency 30" and maybe the number of entries in the color_map.
> 
> Any suggestions on understanding this?
> 
> 
> FYI,
> I want to make some areas of the cross-section transparent (hence the rgbt).
> 
> I want to be able to animate the rotation of the colors around the section. That
> seems controllable e.g. "rotate x * frame_number"
> 
> 
> Fwiw Here's my version based on Bob's code:
> 
> 
> 
> // BEGIN wedges in torus cutaway
> camera {
>  location -3*z
>  look_at 0
> // rotate <30,0,0>
> }
> 
> 
> sky_sphere {
>   pigment {
>     gradient y
>     color_map {
>       [0.0 rgb <0.6,0.7,1.0>]
>       [0.7 rgb <0.0,0.1,0.8>]
>     }
>   }
> }
> 
> 
> 
> light_source {
>  -10*z,
>  1
>  //rotate <60,45,0>
> }
> 
> light_source {
>   <0, 0, 0>            // light's position (translated below)
>   color rgb <1, 1, 1>  // light's color
>   translate <-30, 30, -30>
> }
> 
> 
> difference {
>  torus {
>   1,0.5
>  }
>  torus {
>   1,0.45
>  }
> 
>  plane {
>   x,0
>   rotate -90*y
>  }
>  texture {
>   pigment {
>    radial frequency 30
>    color_map {
>       [0.25  color rgb <1,0,0>]
>       [0.50 color rgb <0,1,0>]
> //      [0.50 color rgbt <0,0,1>]
>       [0.75 color rgbt <0,0,1,1>]
>       [1.00 color rgbt <1,1,1>]
>       [1.00 color rgbt <1,1,1>]
>    }
>    rotate 90*z
>    rotate x * frame_number
>    warp {
>     toroidal orientation y dist_exp 1 major_radius 1
>    }
>   } // pigment
>  }
> }
> // END
> 
> 
> 
Instead of using a rotation, why not use phase?
It becomes:

texture {
   pigment {
    radial frequency 30
    color_map {
       [0.25  color rgb <1,0,0>]
       [0.50 color rgb <0,1,0>]
//      [0.50 color rgbt <0,0,1>]
       [0.75 color rgbt <0,0,1,1>]
       [1.00 color rgbt <1,1,1>]
       [1.00 color rgbt <1,1,1>]
    } phase clock //added
    rotate 90*z
    //rotate x * frame_number commented out
    warp {
     toroidal orientation y dist_exp 1 major_radius 1
    }

That way, it work for any frequency, and for an animation with any number of 
frames. If you add +kc in the command line options or the ini file, you'll get a 
smooth continuous rotation.

-- 
Alain
-------------------------------------------------
I believe that banking institutions are more dangerous to our liberties than
standing armies. Already they have raised up a monied aristocracy that has
set the government at defiance. The issuing power should be taken from the
banks and restored to the people to whom it properly belongs.
Thomas Jefferson


Post a reply to this message

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