|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Ok I am trying to make a box that starts at the top with a red color, ends
at the bottem with black and the color morphs from red to black as you go
from top to bottem. I am reading the manual to try to figure this but I am
lost. and I have the strong feeling that this is in there somewhere
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> Ok I am trying to make a box that starts at the top with a red color, ends
> at the bottem with black and the color morphs from red to black as you go
> from top to bottem. I am reading the manual to try to figure this but I am
> lost. and I have the strong feeling that this is in there somewhere
This can be done with a simple color_map:
box {
<1,2,3>, <4,5,6>
pigment {
gradient y // pattern that goes from 0 to 1 over and over as you go
upwards
color_map {
[0 rgb <0,0,0>] // black at bottom
[1 rgb <1,0,0>] // red at top
}
scale <1, 3.001, 1> // scale by slightly more than the box's height
in the y-direction
translate 1.9995*y // translate so the bottom almost matches up with
the bottom of the box
}
}
Note that I scaled the pattern slightly higher than the box's height so that
the top and bottom surface of the box would not be right at the place where
the red abruptly transitions into black, causing possible artifacts.
- Slime
[ http://www.slimeland.com/ ]
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
That worked perfectly. Thanks Dude!
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
// Hi Barehunter,
//
// the possible artifacts mentioned by Slime are most easily
// avoided with triangle_wave. Note the multiplication by 2
// in the scale; this is neccesary because the triangle_wave
// pattern contains 2 repetitions of the gradient pattern
// (one "forward" and one "backward").
//
// If you delete the key word "triangle-wave", remove "2*"
// from the scale, and render without anti-alias, the artifacts
// become visible, esp. on the black underside.
//
// Sputnik
#declare BoxX = 1;
#declare BoxY = 2;
#declare BoxZ = 3;
#declare Box =
box { 0, <BoxX, BoxY, BoxZ>
pigment {
gradient y
triangle_wave
color_map { [0 red 0] [1 red 1] }
scale <1, 2*BoxY, 1>
}
finish { ambient 1 diffuse 0 }
translate -<BoxX, BoxY, BoxZ>/2
}
background { rgb 0.3 }
object { Box rotate -20*x translate <-BoxX, 0, 1.5*BoxZ> }
object { Box rotate 20*x translate < BoxX, 0, 1.5*BoxZ> }
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
|
|