POV-Ray : Newsgroups : povray.general : request for pigment help : Re: request for pigment help Server Time
30 Jul 2024 16:19:04 EDT (-0400)
  Re: request for pigment help  
From: Chris B
Date: 26 Oct 2008 19:20:26
Message: <4904fb3a@news.povray.org>
"Chris B" <nom### [at] nomailcom> wrote in message 
news:4904d878$1@news.povray.org...
>
> "Leef_me" <nomail@nomail> wrote in message 
> news:web.4904bd7445e043c998cd18890@news.povray.org...
>>
>> I want to apply a color map to a torus so that the maps are applied as 
>> wedges
>> when viewing a cross-section of the torus.
>> (I think this would be radially, but I am unsure.)
>>
>> Can some give me a simple example of this?
>>
>> Thanks in advance.
>>
>> Leef_me

Or. To give you a pattern like a pie chart on the twin circular sections 
through the torus, the only way I can think of is to build it up using cone 
objects for textures rather than a color map. (I tried experimenting with 
toroidal warp of a gradient and a radial texture, but failed to get anything 
that mapped a color map in that way).

The following example builds a layered texture using planes and cones that 
follows the circular path around the torus.

camera {location <0,2,-4> look_at 0}
light_source {<-1,5,-50>, rgb 1}

difference {
  torus { 1, 0.4}
  plane {z,0}
  texture {pigment {rgb <1,1,1>}}
  texture {
    pigment {
      object {
        plane {y,0}
        color rgb <1,1,0>
        color rgbt 1
      }

    }
  }
  texture {
    pigment {
      object {
        difference {
          cone {0,1,y,1.5}
          cone {0,1,y,0.5}
        }
        color rgbt 1
        color rgb <1,0,0>
      }
    }
  }
  texture {
    pigment {
      object {
        cone {0,1,-y,0.5}
        color rgbt 1
        color rgb <0,1,0>
      }
    }
  }
}


Post a reply to this message

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