POV-Ray : Newsgroups : povray.general : request for pigment help Server Time
30 Jul 2024 14:17:41 EDT (-0400)
  request for pigment help (Message 1 to 10 of 12)  
Goto Latest 10 Messages Next 2 Messages >>>
From: Leef me
Subject: request for pigment help
Date: 26 Oct 2008 15:00:01
Message: <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


Post a reply to this message

From: Chris B
Subject: Re: request for pigment help
Date: 26 Oct 2008 16:52:08
Message: <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


Do you mean something like:

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

torus { 1, 0.1
  pigment {
    radial
    color_map {
      [0.0  color rgb <1,0,0>]
      [0.3  color rgb <1,0,0>]
      [0.3  color rgb <0,1,0>]
      [0.6  color rgb <0,1,0>]
      [0.6  color rgb <0,0,1>]
      [1.0  color rgb <0,0,1>]
    }
  }
}


Post a reply to this message

From: Mike Williams
Subject: Re: request for pigment help
Date: 26 Oct 2008 18:54:36
Message: <zGPz2+HvTPBJFwAz@econym.demon.co.uk>
Wasn't it Leef_me who wrote:
>
>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?

Use map_type 5.

Create your torus with major axis equal to 1, because that's where the 
map_type 5 pigment radiates from, then scale it to the size you require 
after applying the pigment.


difference {
   torus {1, 0.6}
   box {<0,-1,-2> <2,1,0>}
   pigment {
     image_map {jpeg "test.jpg" map_type 5}
   }
   scale 4
}

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: Chris B
Subject: Re: request for pigment help
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

From: Bob Hughes
Subject: Re: request for pigment help
Date: 26 Oct 2008 20:08:00
Message: <49050660$1@news.povray.org>
"Chris B" <nom### [at] nomailcom> wrote in message 
news:4904fb3a@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.)
>
> 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).


Interesting solution, if this is the thing being asked for.
Yeah, when I saw this message post I was going to try radial, then warp it, 
just to see if it could be done the way I figured would work right and it 
only gets nearly there:

// BEGIN wedges in torus cutaway
camera {
 location -3*z
 look_at 0
 rotate <30,0,0>
}

light_source {
 -99*z,
 1
 rotate <60,45,0>
}

difference {
 torus {
  1,0.5
 }
 plane {
  x,0
  rotate -90*y
 }
 texture {
  pigment {
   radial frequency 40
   color_map {
    [0.5 rgb 0.1]
    [0.5 rgb 0.9]
   }
   rotate 90*z
   warp {
    toroidal orientation y dist_exp 1 major_radius 1
   }
  } // pigment
 }
}
// END

For reasons unknown to me the pattern doesn't have the symmetry I expected. 
Maybe somebody out there understands why not...?

Bob H.


Post a reply to this message

From: Leef me
Subject: Re: request for pigment help
Date: 26 Oct 2008 22:05:00
Message: <web.49052186d757dcd7892adb1d0@news.povray.org>
"Bob Hughes" <omniverse charter net> wrote:
> "Chris B" <nom### [at] nomailcom> wrote in message
> news:4904fb3a@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.)
> >
> > 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).
>
>
> Interesting solution, if this is the thing being asked for.
> Yeah, when I saw this message post I was going to try radial, then warp it,
> just to see if it could be done the way I figured would work right and it
> only gets nearly there:
>
> // BEGIN wedges in torus cutaway
> camera {
>  location -3*z
>  look_at 0
>  rotate <30,0,0>
> }
>
> light_source {
>  -99*z,
>  1
>  rotate <60,45,0>
> }
>
> difference {
>  torus {
>   1,0.5
>  }
>  plane {
>   x,0
>   rotate -90*y
>  }
>  texture {
>   pigment {
>    radial frequency 40
>    color_map {
>     [0.5 rgb 0.1]
>     [0.5 rgb 0.9]
>    }
>    rotate 90*z
>    warp {
>     toroidal orientation y dist_exp 1 major_radius 1
>    }
>   } // pigment
>  }
> }
> // END
>
> For reasons unknown to me the pattern doesn't have the symmetry I expected.
> Maybe somebody out there understands why not...?
>
> Bob H.


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


Post a reply to this message

From: Bob Hughes
Subject: Re: request for pigment help
Date: 27 Oct 2008 00:25:43
Message: <490542c7@news.povray.org>
"Leef_me" <nomail@nomail> wrote in message 
news:web.49052186d757dcd7892adb1d0@news.povray.org...
>
> So far, Bob got the idea of what I was looking for, but I still have one
> concern.

Well, Chris was onto something good there first. And when I saw Mike's image 
map idea that seemed easiest, I'm just not sure if a single image with 
horizontal lines can be changed (increasing/decreasing number of wedges) 
within POV alone by scaling for example since I also can't remember that 
about map_type 5.

> 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?

That's part of what confused me. I must admit I haven't used the toroidal 
warp in what's probably been years. Maybe never with radial pattern. I 
thought it would take one slice of radial pattern and wrap it using the 
exact number of iterations from frequency. Of course, I could still be doing 
something wrong.

> 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"

You have the right iea there, I believe, yes. Although, a quick check on 
that shows once again something isn't right about my using frequency 30 to 
get the much fewer wedges than expected and how it rotates. For instance, 
using rotate x*48*clock with that and your color_map seems to complete 
approx. one revolution, so the usual x*360*clock is far too much (360 being 
degrees, of course) instead of going one time around. Due to the multiples 
caused by 30 in frequency, perhaps, yet that still doesn't match up. A 
frequency 1 and a color map list of a specific number of entries seems to 
not be right either for whatever reason.

So unless something can be done about figuring the correct way to get a 
singular radial pattern mapped into the torus it won't be simple to animate. 
Which is why I'm thinking Mike has the best solution using image_map and 
map_type 5, if you just give it a palletted image to work with the colors 
and transparency.

But I can't help wonder what's going on with radial pattern being warp'd and 
not adhereing to its original pattern, distorting in a somewhat non-toroidal 
way or imperfectly anyhow. Maybe...

> Fwiw Here's my version based on Bob's code:

See previous message...


-- 
/*bob hughes*/


Post a reply to this message

From: Dan Connelly
Subject: Re: request for pigment help
Date: 27 Oct 2008 08:37:12
Message: <4905b5f8$1@news.povray.org>
Leef_me wrote:

> 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?
> 

Frequency makes different sections indistinguishable.

To make the segments different colors, you need to use the map.

For example, if the map is from 0 to 1 around the circle, and you want 12 equal
segments, you:

[1/12 pigment1]
[1/12 pigment2]
[2/12 pigment2]
[2/12 pigment3]
[3/12 pigment3]
[3/12 pigment4]

etc.

Dan


Post a reply to this message

From: Alain
Subject: Re: request for pigment help
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

From: Bob Hughes
Subject: Re: request for pigment help
Date: 27 Oct 2008 14:15:31
Message: <49060543$1@news.povray.org>
"Alain" <ele### [at] netscapenet> wrote in message 
news:4905d7b6$1@news.povray.org...
> 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>]

Forgot to mention before about this last color map entry not being needed.

>    } 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.

Good idea, but in this case it might not be able to do what's wanted if a 
frequency number is used.

I found that frequency 8 is what creates one complete color map for this. 
Multiples of 8 make duplicates, so 32 creates 4 instances of color map.
It's a strange thing that might be a bug in how this particular warp gets 
applied to radial pattern, along with the curious shrinking from zero to one 
for the color entries and any duplicates of the whole.

For a better look at it try this:

camera {
 location -3*z
 look_at 0
 angle 50
 translate -x
}

difference {
 torus {
  1,0.5
 }
 plane {
  x,0
  rotate -90*y
 }
 texture {
  pigment {
   radial frequency 8 // 8 creates a complete circuit of radial, use 
multiples for more
   color_map {
    [0 blue 1] // make beginning more visible
    [0.1 rgb 0.1]
    [0.9 rgb 0.9]
    [1 red 1] // make ending more visible
   }
   //triangle_wave // use frequency 4, or half number when not ramp_wave 
form
   //phase clock
   rotate -90*z
   warp {
    toroidal orientation <0,1,0> dist_exp 1 major_radius 1
   }
  }
  finish {
   ambient 1 diffuse 0
  }
 }
}

You will notice how the pigment pattern apparently compresses as it wraps 
around the torus in a CC direction.

Bob H


Post a reply to this message

Goto Latest 10 Messages Next 2 Messages >>>

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