POV-Ray : Newsgroups : povray.general : 2 color sphere Server Time
1 Nov 2024 03:15:50 EDT (-0400)
  2 color sphere (Message 1 to 6 of 6)  
From: David Vincent-Jones
Subject: 2 color sphere
Date: 22 Nov 1999 17:31:59
Message: <3839c45f@news.povray.org>
Should be very simple
A sphere with one half red and one half white
If I want multiple stripes it is really no problem but just half and half
appears to elude me.

sphere { <0, 0, 0> 1
        pigment { gradient x
        color_map { [0 color Red][ 0.5 color Red][0.5 color White][1 color
White] }}}

I have tried several radius options
Can somebody see the problem here...?


Post a reply to this message

From: Chris Huff
Subject: Re: 2 color sphere
Date: 22 Nov 1999 17:35:14
Message: <221119991738217992%chrishuff_99@yahoo.com>
In article <3839c45f@news.povray.org>, David Vincent-Jones
<geo### [at] galaxynetcom> wrote:

> Should be very simple
> A sphere with one half red and one half white
> If I want multiple stripes it is really no problem but just half and half
> appears to elude me.

Try this:
sphere {<0, 0, 0>, 1
    pigment { gradient x
        color_map {
            [0.0 color Red]
            [0.5 color Red]
            [0.5 color White]
            [1.0 color White]
        }
        scale 2
        translate y*1
    }
}

The radius of the sphere is 1, so it is 2 units across. The gradient
needs to be translated and scaled to fit.

-- 
Chris Huff
e-mail: chr### [at] yahoocom
Web page: http://chrishuff.dhs.org/


Post a reply to this message

From: Chris Huff
Subject: Re: 2 color sphere
Date: 22 Nov 1999 17:39:36
Message: <221119991742443850%chrishuff_99@yahoo.com>
Oh, and this should probably have been posted to one of the other
groups like povray.newusers or povray.advanced-users. For such a basic
question, .newusers would probably have been the best place.
Also, the planar pattern might be a better choice for some things.

Maybe I should write another list pattern which colors different sides
of a plane, so it would be independant of object size...on the other
hand, my object pattern using a plane would do the same thing, so that
feature would be redundant.

-- 
Chris Huff
e-mail: chr### [at] yahoocom
Web page: http://chrishuff.dhs.org/


Post a reply to this message

From: Chris Huff
Subject: Re: 2 color sphere
Date: 22 Nov 1999 17:44:32
Message: <221119991747391699%chrishuff_99@yahoo.com>
In article <221119991738217992%chr### [at] yahoocom>, Chris Huff
<chr### [at] yahoocom> wrote:

I made a mistake, I read "gradient x" as "gradient y". It should be
translated along the same axis as the gradient, so "translate y*1"
should be "translate x*1".

-- 
Chris Huff
e-mail: chr### [at] yahoocom
Web page: http://chrishuff.dhs.org/


Post a reply to this message

From: Peter Popov
Subject: Re: 2 color sphere
Date: 22 Nov 1999 18:30:38
Message: <e9A5OA9ueQ53LfHjKiGEwF9BUfsT@4ax.com>
On Mon, 22 Nov 1999 14:32:05 -0800, "David Vincent-Jones"
<geo### [at] galaxynetcom> wrote:

>Should be very simple
>A sphere with one half red and one half white
>If I want multiple stripes it is really no problem but just half and half
>appears to elude me.

sphere
{
  0, 1
  pigment 
  { planar color_map { [0 Red][0.5 Red][0.5 White][1 White] }
    scale 2 translate -y rotate 90*z
  }
}

    
Peter Popov
ICQ: 15002700


Post a reply to this message

From: mr art
Subject: Re: 2 color sphere
Date: 22 Nov 1999 23:27:23
Message: <383A178A.77990CA@gci.net>
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
I know that you people already know this one, but here goes anyway:
<br>color_map { [0 Red][0.5 Red][0.5 White][1 White] }
<br>is the same as
<br>color_map {[0.5 Red][0.5 White]}
<br>Well, except it is shorter.
<br>For some reason, one that I like, POV  fills in the rest.
<p>Peter Popov wrote:
<blockquote TYPE=CITE>On Mon, 22 Nov 1999 14:32:05 -0800, "David Vincent-Jones"
<br><geo### [at] galaxynetcom> wrote:
<p>>Should be very simple
<br>>A sphere with one half red and one half white
<br>>If I want multiple stripes it is really no problem but just half and
half
<br>>appears to elude me.
<p>sphere
<br>{
<br>  0, 1
<br>  pigment
<br>  { planar color_map { [0 Red][0.5 Red][0.5 White][1 White] }
<br>    scale 2 translate -y rotate 90*z
<br>  }
<br>}
<br> 
<p>Peter Popov
<br>ICQ: 15002700</blockquote>
</html>


Post a reply to this message

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