|
![](/i/fill.gif) |
apologies about the word wrapping, should be:
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 complete circuit, use multiples for more
color_map {
[0 blue 1]
[0.1 rgb 0.1]
[0.9 rgb 0.9]
[1 red 1]
}
//triangle_wave // use frequency 4 or half 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 1
}
}
}
--
/*bob hughes*/
Post a reply to this message
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
/* Final version of code
Hollow Donut shape with transparent areas, with rotating pattern
Thanks to the following posters:
Chris B
Mike Williams
Bob Hughes
Dan Connelly
Alain
"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?
Besides the code I wanted, I have learned the following:
Think about what you want to say before you speak/write
fractions for color map index values, (what a concept!)
"phase" is nicer to work with than clock/PI+360\pain for animations
texture {
pigment {
radial frequency 64 // 8 creates a complete circuit of radial,
//use multiples for more
color_map {
#include "colors.inc" can be very useful
color maps can have transparent entries,
Some forms of statements are easier to read/comprehend than others
[1/4 color rgbt <1,0,0,0.5>]
[1/4 color Red transmit 0.5]
*/
// Standard pre-defined colors
//
#include "colors.inc"
// BEGIN wedges in torus cutaway
camera {
location <-1,2,-3>
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>]
}
}
}
plane {
y, -1
pigment { color rgb <1,1,1> }
}
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
}
#if(1)
torus {
1,0.49
}
#end
#if(0) // turned off the cross-sectioning to see the whole torus
plane {
x,0
rotate -90*y
}
#end
no_shadow
#declare xmit= .5;
texture {
pigment {
radial frequency 64 // 8 creates a complete circuit of radial,
//use multiples for more
color_map {
[0 color White]
[0 color Red]
[1/4 color Red]
[1/4 color Yellow transmit xmit]
[1/2 color Yellow transmit xmit]
[1/2 color Green]
[3/4 color Green]
[3/4 color Blue transmit xmit]
[1/1 color Blue transmit xmit]
}
//triangle_wave // use frequency 4, or half number
//when not ramp_wave form
phase clock
rotate 90*z
warp {
toroidal orientation y dist_exp 1 major_radius 1
}
} // pigment
}
}
// END
Post a reply to this message
|
![](/i/fill.gif) |