POV-Ray : Newsgroups : povray.newusers : Colors : Re: Colors Server Time
29 Jul 2024 22:24:24 EDT (-0400)
  Re: Colors  
From: Stefan Viljoen
Date: 23 Feb 2005 12:11:18
Message: <421cb935@news.povray.org>
The right honourable Georg Olesen spake:

> Hi,
>   I have a very simple question, and yet I can't figure it out my self:-(
> How do I, say color a sphere with the one half red and the other half
> green? Or how do I make a box, where all the sides are blue except for one
> which i red with a white cross on it?
> 
> In advance thanx
> 
> Kind Regards
> Georg

CSG should do nicely. Check in the Pov documentation - to make a sphere with
two colors, for example, take a sphere, "difference" this with a cube (see
the docs), then intersect the whole sphere with another cube with the color
you want set in the CSG.

Something like (coordinates are ephemeral)

difference{

sphere
{
        <0,0,0>,1
}

box
{
 <-1,-1,-1>,<1,1,1>
}

material{texture{pigment{color Green}}}

}//difference

intersect{

sphere
{
        <0,0,0>,1
}

box
{
 <-1,-1,-1>,<1,1,1>
}

material{texture{pigment{color Red}}}

}//intersect

Take a look at the CSG section in the Pov docs - it should be obvious
immediately how to do this.

-- 
---
Stefan Viljoen
Software Support Technician
Polar Design Solutions


Post a reply to this message

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