POV-Ray : Newsgroups : povray.newusers : Colors Server Time
25 Nov 2024 22:53:14 EST (-0500)
  Colors (Message 1 to 4 of 4)  
From: Georg Olesen
Subject: Colors
Date: 23 Feb 2005 10:25:00
Message: <web.421c9f15c512c6a9a278c9190@news.povray.org>
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


Post a reply to this message

From: Stefan Viljoen
Subject: Re: Colors
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

From: Alain
Subject: Re: Colors
Date: 24 Feb 2005 20:03:49
Message: <421e7975$1@news.povray.org>
Georg Olesen nous apporta ses lumieres en ce 2005-02-23 10:19:
> 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
> 
> 
For the sphere, you can use a gradient pattern with a colour_map like:
colour_map{[0.5 red][0.5 blue]} scaled a little larger than the sphere and translated
so the change 
matches the center of the sphere.
For the box you mention, using an intersection of 6 planes, 5 with a blue pigment and
1 with an 
image_map of the swiss flag.

Alain


Post a reply to this message

From: Christopher James Huff
Subject: Re: Colors
Date: 26 Feb 2005 15:46:08
Message: <cjameshuff-384D4C.15462326022005@news.povray.org>
In article <web.421c9f15c512c6a9a278c9190@news.povray.org>,
 "Georg Olesen" <vib### [at] hotmailcom> wrote:

>   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 addition to the other suggestions, you could use an object pattern 
with a simple plane for the first one...it'd actually be simpler than 
using a gradient pattern.

The box would be difficult to do with an object pattern, though, the 
suggestion of using an intersection of planes is probably best. However, 
you should note that POV will not automatically bound such an 
intersection. If you have a lot of them in the scene, you should 
manually bound them.

-- 
Christopher James Huff <cja### [at] gmailcom>
POV-Ray TAG: <chr### [at] tagpovrayorg>
http://tag.povray.org/


Post a reply to this message

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