POV-Ray : Newsgroups : povray.newusers : shapes and colors : Re: shapes and colors Server Time
28 Jul 2024 18:11:52 EDT (-0400)
  Re: shapes and colors  
From: Leroy
Date: 4 Dec 2007 00:00:19
Message: <4754DE9C.30403@joplin.com>
Leroy wrote:
> Your both right, I wasn't thinking! :( I didn't even test it.
> I'd been using the box pattern on a two dimension surface.
> It don't expand to 3d object that easily.

Try this I didn't write it I want to say Warp did but can't be sure

#declare Pig=pigment{boxed color_map{[.1 Red][.1 Blue]}scale<.9,.9,1.5>}

#declare Pyramid = function { abs(x) < y & abs(z) < y };

#declare CubePattern =
   function
   { Pyramid(x, -z, y)*1/6+
     Pyramid(y, x, z)*2/6+
     Pyramid(x, z, y)*3/6+
     Pyramid(y, -x, z)*4/6+
     Pyramid(x, -y, z)*5/6
   };
#declare ThePigment =
   pigment
   { function { CubePattern(x, y, z) }
     pigment_map
     { [0/6 Pig rotate x*90] //top
       [1/6 Pig]              //front
       [2/6 Pig rotate -y*90]//left
       [3/6 Pig rotate -y*180]//back
       [4/6 Pig rotate y*90] //right
       [5/6 Pig rotate -x*90] //bottom
     }
   };

box{-1,1 pigment{ThePigment}}

You could replace the pigment statment with 6 different image_map 
pigments if ya like.

Have fun!


Post a reply to this message

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