|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Rafal 'Raf256' Maj" <raf### [at] raf256com> wrote in message
news:Xns### [at] 204213191226...
>
> union { // my space ship - part of BIG scene
> union {
> // 30 lines - random spheres - damage from bullets
> }
> and You want fastly check how ship would like without random spheres
> damage.
>
I'd have something like:
difference{
#declare numbull=100;
#declare n=0;
#while(n<numbull)
sphere {RANDOM_LOCATION, SIZE }
#declare n=n+1;
#end
}
Then test various values of numbull
You could even but your numbull declaration at the top of the code to make
it easier to find.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Rafal 'Raf256' Maj" <raf### [at] raf256com> wrote in message
news:Xns### [at] 204213191226...
> Would it be a big problem to allow syntax :
>
> #macro finWater1 reflection { .01 .2 } #end
> finish { finWater1 }
>
> instead of finish { finWater1() }
>
I don't see the point. Usually macros are used to pass new variables into
repeated code i.e,
#macro finWater1 (minref,maxref)
reflection { minref,maxref }
#end
finish { finWater1(.01,.2) }
Since you are not passing variables you should just use a #declare,
#declare finWater1= finish{reflection { .01 .2 }}
finish{finWater1}
-tgq
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
There are some cases where you cant use #declare for example in a blob but
you are right that in the examples he gave #declare would have been better.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Simon Adameit" <gom### [at] gmxde> wrote in news:3d9af521@news.povray.org
> There are some cases where you cant use #declare for example in a blob
> but you are right that in the examples he gave #declare would have
> been better.
example that I give here is in fact quite poor, I thought about this
macro's when creating i.e. textures.
compare :
pigment { marble cmapGray } // imho bets - now impossible
pigment { marble cmapGray() } // almost best
pigment { marble color_map {cmapGray } }// typical
pigment { marble color_map{[0 color rgb 0][color rgb 1]}// worst
or even better - example with creating long color_maps example - above
another example - 1 block with 2 definitions, like
finish { finWater finGlow }
where finWater is reflection,specular,etc
and finGlow is ambient / diffuse settings
--
#macro g(U,V)(.4*abs(sin(9*sqrt(pow(x-U,2)+pow(y-V,2))))*pow(1-min(1,(sqrt(
pow(x-U,2)+pow(y-V,2))*.3)),2)+.9)#end#macro p(c)#if(c>1)#local l=mod(c,100
);g(2*div(l,10)-8,2*mod(l,10)-8)*p(div(c,100))#else 1#end#end light_source{
y 2}sphere{z*20 9pigment{function{p(26252423)*p(36455644)*p(66656463)}}}//M
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Simon Adameit" <gom### [at] gmxde> wrote in news:3d9ac841@news.povray.org
> I dont see why one would want to use macros anyway in such a case.
50% shorten code ? in scene with many code as above it DO mater
--
#macro g(U,V)(.4*abs(sin(9*sqrt(pow(x-U,2)+pow(y-V,2))))*pow(1-min(1,(sqrt(
pow(x-U,2)+pow(y-V,2))*.3)),2)+.9)#end#macro p(c)#if(c>1)#local l=mod(c,100
);g(2*div(l,10)-8,2*mod(l,10)-8)*p(div(c,100))#else 1#end#end light_source{
y 2}sphere{z*20 9pigment{function{p(26252423)*p(36455644)*p(66656463)}}}//M
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Rafal 'Raf256' Maj" wrote:
>
> > I dont see why one would want to use macros anyway in such a case.
>
> 50% shorten code ? in scene with many code as above it DO mater
>
#declare blah=
something{}
#macro blah()
#end
How is that 50% shortened code?
Using declare has also some advantages macros dont have.
Afaik it needs less memory to use #declare than to use a macro if you are
going to use the thing several times and not only once.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Simon Adameit" <gom### [at] gmxde> wrote in news:3d9afacc@news.povray.org
> How is that 50% shortened code?
I don't understant ? The example is :
color_map {
[0.0 colEye]
[0.1 colEye]
[0.11 colSkin]
[0.5 colSkin]
[1.0 colBlood]
}
// -----------
color_map {
[0.0 colEye() ]
[0.1 colEye() ]
[0.11 colSkin() ]
[0.5 colSkin() ]
[1.0 colBlood() ]
}
// -----------
color_map {
[0.0 color rgbft colEye]
[0.1 color rgbft colEye]
[0.11 color rgbft colSkin]
[0.5 color rgbft colSkin]
[1.0 color rgbft colBlood]
}
macro() Vs define is much shorter, macro() Vs macro is a little bit
shorter, but on the other hand it's probably easy to implement
--
#macro g(U,V)(.4*abs(sin(9*sqrt(pow(x-U,2)+pow(y-V,2))))*pow(1-min(1,(sqrt(
pow(x-U,2)+pow(y-V,2))*.3)),2)+.9)#end#macro p(c)#if(c>1)#local l=mod(c,100
);g(2*div(l,10)-8,2*mod(l,10)-8)*p(div(c,100))#else 1#end#end light_source{
y 2}sphere{z*20 9pigment{function{p(26252423)*p(36455644)*p(66656463)}}}//M
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Rafal 'Raf256' Maj <raf### [at] raf256com> wrote:
> [0.0 color rgbft colEye]
Did you use the obsolete 'color' keyword there on purpose, just to make
it look longer than necessary?
--
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}// - Warp -
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Warp <war### [at] tagpovrayorg> wrote in news:3d9b004b@news.povray.org
>> [0.0 color rgbft colEye]
> Did you use the obsolete 'color' keyword there on purpose, just to make
> it look longer than necessary?
uuuups ;)
sorry I realy chould check that before posting :(
--
#macro g(U,V)(.4*abs(sin(9*sqrt(pow(x-U,2)+pow(y-V,2))))*pow(1-min(1,(sqrt(
pow(x-U,2)+pow(y-V,2))*.3)),2)+.9)#end#macro p(c)#if(c>1)#local l=mod(c,100
);g(2*div(l,10)-8,2*mod(l,10)-8)*p(div(c,100))#else 1#end#end light_source{
y 2}sphere{z*20 9pigment{function{p(26252423)*p(36455644)*p(66656463)}}}//M
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Rafal 'Raf256' Maj" wrote:
> [1.0 color rgbft colBlood]
>
You declare the color this way:
#declare Col=rgb<1,2,3>;
and then use it this way:
[1.0 Col]
Using declared things is even shorter than calling the macro, so the only
thing that could but not always is longer is the definition. I dont
understamd why you use "color rgbft". To make things look how you want them
to?
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |