POV-Ray : Newsgroups : povray.binaries.images : Difficult simple object : Re: Difficult simple object Server Time
18 Aug 2024 20:12:06 EDT (-0400)
  Re: Difficult simple object  
From: Mark James Lewin
Date: 15 Mar 2001 01:09:44
Message: <3AB05C07.35607BDE@yahoo.com.au>
Is this what you were after?

Done like this...

#declare XM = (15/20)*cos(degrees(60));
#declare ZM = (15/20)*sin(degrees(60));

#declare F1 =
function
        {
        ceil((-((x-(15/20))^2 + y^2 + z^2) + (1^2)))
        }

#declare F2 =
function
        {
        ((ceil((-((x+(XM))^2 + y^2 + (z-(ZM))^2) + (1^2)))))
        }

#declare F3 =
function
        {
        ((ceil((-((x+(XM))^2 + y^2 + (z+(ZM))^2) + (1^2)))))
        }



#declare RGBPig =
pigment
        {
        function
                {
                (if((F1),1,0) +
                if(F2,2,0) +
                if(F3,4,0))/7
                }
        scale 20
        colour_map
                {
                [0/7 rgb <0,0,0>]
                [1/7 rgb <1,0,0>]
                [2/7 rgb <0,1,0>]
                [3/7 rgb <1,1,0>]
                [4/7 rgb <0,0,1>]
                [5/7 rgb <1,0,1>]
                [6/7 rgb <0,1,1>]
                [7/7 rgb <1,1,1>]
                }
        }

difference
        {
        union
                {
                sphere
                        {
                        <15,0,0>
                        19.99

                        }

                sphere
                        {
                        <-20*XM,0,20*ZM>
                        19.99
                        }

                sphere
                        {
                        <-20*XM,0,-20*ZM>
                        19.99
                        }
                }

        box
                {
                <-50,0,-50>
                <50,50,50>
                }

        texture { pigment {RGBPig} finish { diffuse 1}}
        }


Post a reply to this message


Attachments:
Download 'colouradd.png' (6 KB)

Preview of image 'colouradd.png'
colouradd.png


 

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