|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
i'm using a while statment to make a bunch of "things" as they rise on
the y access i'd like them to incease certain colors. how would i use an
array to do this?
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Noah A wrote:
>
> i'm using a while statment to make a bunch of "things" as they rise on
> the y access i'd like them to incease certain colors. how would i use an
> array to do this?
An array is one possible solution but it would probably be easier to
eimple use the value of the while loop to increment the colors.
#declare a = 0;
#while (a < 10 )
sphere {<0,a,0>, 1
pigment { rgb <a*0.1, a*0.1, a*0.1> }
}
}
#declare a = a + 1;
#end
The above example will change each rgb value by 0.1 for each sphere it
produces. There are tricks to using this approach and the example I gave
is a very basic one. If you really want to change the colors using an array
you will still need to write out each color you want to store in the array
before passing it into the while loop. This could be a very tedious task
but it is possible if you really want to do it. If my while loop example
is not what you want let me know and I will work out an array solution for
you.
--
Ken Tyler
See my 700+ Povray and 3D Rendering and Raytracing Links at:
http://home.pacbell.net/tylereng/index.html
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
I suggest you use this interpolation macro, it's very flexible:
//Interpolation
//GC - global current
//GS - global start
//GE - global end
//TS - target start
//TE - target end
//EXP - interpolation exponent (linear, cubic etc.)
#macro Interpolate(GC,GS,GE,TS,TE,EXP)
(TS+(TE-TS)*pow((GC-GS)/(GE-GS),EXP))
#end
Do something like this:
#declare StartColor=<1,1,0>;
#declare EndColor=<0,1,0>;
#declare N=10;
#declare C=0;
#while(C<10)
sphere{y*C, 0.5
pigment{rgb Interpolate(C,0,N,StartColor,EndColor,1)}
}
#declare C=C+1;
#end
Here, pigment changes from StartColor to EndColor as C changes from 0 to N. The
final parameter is 1, meaning linear interpolation.
I use this macro extensively, even though this particular example could be
achieved more efficiently.
Margus
Noah A wrote:
>
> i'm using a while statment to make a bunch of "things" as they rise on
> the y access i'd like them to incease certain colors. how would i use an
> array to do this?
Post a reply to this message
|
|
| |
| |
|
|
From: Nieminen Mika
Subject: Re: how do i get on the up and up with color?
Date: 11 Aug 1999 03:04:16
Message: <37b12070@news.povray.org>
|
|
|
| |
| |
|
|
Ken <tyl### [at] pacbellnet> wrote:
: #declare a = 0;
: #while (a < 10 )
: sphere {<0,a,0>, 1
: pigment { rgb <a*0.1, a*0.1, a*0.1> }
: }
: }
: #declare a = a + 1;
: #end
But Ken! That's quite good indentation... :)
(Although the #while and the #end are not indented at the same level...)
--
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Nieminen Mika wrote:
>
> Ken <tyl### [at] pacbellnet> wrote:
> : #declare a = 0;
> : #while (a < 10 )
> : sphere {<0,a,0>, 1
> : pigment { rgb <a*0.1, a*0.1, a*0.1> }
> : }
> : }
> : #declare a = a + 1;
> : #end
>
> But Ken! That's quite good indentation... :)
> (Although the #while and the #end are not indented at the same level...)
I'm sorry 8`[
--
Ken Tyler
See my 700+ Povray and 3D Rendering and Raytracing Links at:
http://home.pacbell.net/tylereng/index.html
Post a reply to this message
|
|
| |
| |
|
|
From: Nieminen Mika
Subject: Re: how do i get on the up and up with color?
Date: 11 Aug 1999 04:48:57
Message: <37b138f9@news.povray.org>
|
|
|
| |
| |
|
|
Ken <tyl### [at] pacbellnet> wrote:
:> But Ken! That's quite good indentation... :)
: I'm sorry 8`[
I praise you and you are sorry? I don't understand.
--
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Nieminen Mika wrote:
>
> Ken <tyl### [at] pacbellnet> wrote:
> :> But Ken! That's quite good indentation... :)
>
> : I'm sorry 8`[
>
> I praise you and you are sorry? I don't understand.
I do have a reputation to maintain you know !
--
Ken Tyler
See my 700+ Povray and 3D Rendering and Raytracing Links at:
http://home.pacbell.net/tylereng/index.html
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
thank you ken. it works like a charm
Ken wrote:
> Noah A wrote:
> >
> > i'm using a while statment to make a bunch of "things" as they rise on
> > the y access i'd like them to incease certain colors. how would i use an
> > array to do this?
>
> An array is one possible solution but it would probably be easier to
> eimple use the value of the while loop to increment the colors.
>
> #declare a = 0;
> #while (a < 10 )
> sphere {<0,a,0>, 1
> pigment { rgb <a*0.1, a*0.1, a*0.1> }
> }
> }
> #declare a = a + 1;
> #end
>
> The above example will change each rgb value by 0.1 for each sphere it
> produces. There are tricks to using this approach and the example I gave
> is a very basic one. If you really want to change the colors using an array
> you will still need to write out each color you want to store in the array
> before passing it into the while loop. This could be a very tedious task
> but it is possible if you really want to do it. If my while loop example
> is not what you want let me know and I will work out an array solution for
> you.
>
> --
> Ken Tyler
>
> See my 700+ Povray and 3D Rendering and Raytracing Links at:
> http://home.pacbell.net/tylereng/index.html
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Noah A wrote:
>
> thank you ken. it works like a charm
Glad to be of service. Now if you just fix my bounding problem for me...
--
Ken Tyler
See my 700+ Povray and 3D Rendering and Raytracing Links at:
http://home.pacbell.net/tylereng/index.html
Post a reply to this message
|
|
| |
| |
|
|
From: Nieminen Mika
Subject: Re: how do i get on the up and up with color?
Date: 11 Aug 1999 13:11:48
Message: <37b1aed4@news.povray.org>
|
|
|
| |
| |
|
|
Ken <tyl### [at] pacbellnet> wrote:
: I do have a reputation to maintain you know !
Ah, now I understand :)
I assure you that there's nothing you have to be ashamed of.
--
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |