|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Hi all,
I have done this code:
======================================
#declare lipid = union {
blob{ threshold 0.1
sphere {<0, 0, 0>, 2 ,1 texture {pigment { color Red }finish { ambient 0.2
diffuse 0.8 phong 1 }}}
}}
#macro Make_Stuff (Stuff,How_Many)
#local Ample=-12;
#while (Ample<How_Many)
object{Stuff rotate <0,0*Ample,0> translate<3*Ample,9*cos (Ample/8),0> }
#local Ample=Ample+1;
#end
#end
#declare layer = union {Make_Stuff (lipid,100)}
global_settings { max_trace_level 29 }
#macro Make_Many (Stuff,How_Many)
#local Fons=0;
#while (Fons<How_Many)
object{Stuff translate <0,3*sin (Fons/8),3*Fons> translate <10, -20, 30>}
#local Fons=Fons+1;
#end
#end
union {Make_Many (layer,50)}
======================================
How can I unife all the spheres?
Thanks in advance.
Oleguer
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Oleguer Vilella nous apporta ses lumieres en ce 2005-01-29 11:25:
> Hi all,
>
> I have done this code:
> ======================================
> #declare lipid = union {
> blob{ threshold 0.1
> sphere {<0, 0, 0>, 2 ,1 texture {pigment { color Red }finish { ambient 0.2
> diffuse 0.8 phong 1 }}}
> }}
>
> #macro Make_Stuff (Stuff,How_Many)
> #local Ample=-12;
>
> #while (Ample<How_Many)
> object{Stuff rotate <0,0*Ample,0> translate<3*Ample,9*cos (Ample/8),0> }
> #local Ample=Ample+1;
> #end
> #end
>
> #declare layer = union {Make_Stuff (lipid,100)}
> global_settings { max_trace_level 29 }
>
> #macro Make_Many (Stuff,How_Many)
> #local Fons=0;
>
> #while (Fons<How_Many)
> object{Stuff translate <0,3*sin (Fons/8),3*Fons> translate <10, -20, 30>}
> #local Fons=Fons+1;
> #end
> #end
>
> union {Make_Many (layer,50)}
> ======================================
> How can I unife all the spheres?
> Thanks in advance.
>
> Oleguer
>
>
You can start by removing the union and blob from the lipid object:
#declare Lipid=sphere{0,2,1 texture{pigment{color Red}finish{ambient 0.2 diffuse 0.8
phong 1}}}
Then, in the Layer object:
#declare Layer=blob{thresshold 0.1 Make_Stuff(Lipid,100)}
I did not try it.
Note: it's beter to *always* start any user defined identifier with a capital letter,
it prevent any
name clash with built-in reserved name, present and future. Who know if a future
fersion could use
"layer" for some purpose?
Alain
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Wasn't it Oleguer Vilella who wrote:
>Hi all,
>
>I have done this code:
>======================================
>======================================
>How can I unife all the spheres?
Do you mean like this?
#macro Make_All(N,M)
blob {threshold 0.1
#local Ample=-12;
#while (Ample<N)
#local Fons=0;
#while (Fons<M)
sphere {<0,0,0>, 2, 1
rotate <0,0*Ample,0> translate<3*Ample,9*cos (Ample/8),0>
translate <0,3*sin (Fons/8),3*Fons> translate <10, -20, 30>
}
#local Fons=Fons+1;
#end
#local Ample=Ample+1;
#end
}
#end
object {Make_All(100,50)
texture {
pigment { color Red }
finish { ambient 0.2 diffuse 0.8 phong 1 }
}
}
--
Mike Williams
Gentleman of Leisure
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Hi Alain,
Your code gives me an error. It says: "No matching } in 'sphere',, found
instead".
This part of code is:
======================================
#declare Lipid=sphere{0,2,1 texture{pigment{color Red}finish{ambient 0.2
diffuse 0.8 phong 1}}}
======================================
Why this error? I have closed de all the }
Understood that's is better declare the identifiers with a capital letter.
Thanks a lot for reminder me that.
Hi Mike,
Thanks for your help Mike, but that's not what I was looking for. I'm
traying to unify all the spheres to obtain an uniform membrane.
Thanks all the helps,
Oleguer
news:41fc4324$2@news.povray.org...
> Oleguer Vilella nous apporta ses lumieres en ce 2005-01-29 11:25:
>> Hi all,
>>
>> I have done this code:
>> ======================================
>> #declare lipid = union {
>> blob{ threshold 0.1
>> sphere {<0, 0, 0>, 2 ,1 texture {pigment { color Red }finish { ambient
>> 0.2 diffuse 0.8 phong 1 }}}
>> }}
>>
>> #macro Make_Stuff (Stuff,How_Many)
>> #local Ample=-12;
>>
>> #while (Ample<How_Many)
>> object{Stuff rotate <0,0*Ample,0> translate<3*Ample,9*cos (Ample/8),0> }
>> #local Ample=Ample+1;
>> #end
>> #end
>>
>> #declare layer = union {Make_Stuff (lipid,100)}
>> global_settings { max_trace_level 29 }
>>
>> #macro Make_Many (Stuff,How_Many)
>> #local Fons=0;
>>
>> #while (Fons<How_Many)
>> object{Stuff translate <0,3*sin (Fons/8),3*Fons> translate <10, -20,
>> 30>}
>> #local Fons=Fons+1;
>> #end
>> #end
>>
>> union {Make_Many (layer,50)}
>> ======================================
>> How can I unife all the spheres?
>> Thanks in advance.
>>
>> Oleguer
> You can start by removing the union and blob from the lipid object:
> #declare Lipid=sphere{0,2,1 texture{pigment{color Red}finish{ambient 0.2
> diffuse 0.8 phong 1}}}
>
> Then, in the Layer object:
> #declare Layer=blob{thresshold 0.1 Make_Stuff(Lipid,100)}
>
> I did not try it.
> Note: it's beter to *always* start any user defined identifier with a
> capital letter, it prevent any name clash with built-in reserved name,
> present and future. Who know if a future fersion could use "layer" for
> some purpose?
>
> Alain
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Oleguer Vilella nous apporta ses lumieres en ce 2005-01-30 05:13:
> Hi Alain,
>
> Your code gives me an error. It says: "No matching } in 'sphere',, found
> instead".
>
> This part of code is:
> ======================================
> #declare Lipid=sphere{0,2,1 texture{pigment{color Red}finish{ambient 0.2
> diffuse 0.8 phong 1}}}
> ======================================
> Why this error? I have closed de all the }
> Understood that's is better declare the identifiers with a capital letter.
> Thanks a lot for reminder me that.
>
>
>
> Hi Mike,
>
> Thanks for your help Mike, but that's not what I was looking for. I'm
> traying to unify all the spheres to obtain an uniform membrane.
>
> Thanks all the helps,
> Oleguer
>
>
OK, the syntax used is that of a sphere as a blob component, not a regular sphere. You
probably need
to replace that by a macro, or place it inside the Make_Stuff macro.
Alain
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Wasn't it Oleguer Vilella who wrote:
>Hi Mike,
>
>Thanks for your help Mike, but that's not what I was looking for. I'm
>traying to unify all the spheres to obtain an uniform membrane.
Sorry for the late response. I've been unable to establish a link to the
pov newsserver for a few days.
Well, once you've got all the blob components in a single blob object
you can adjust the threshold value, and the strength and radius of the
individual blobs, and the separation between the blobs (like #local
Fons=Fons+0.5), so that they blob together into a bumpy membrane. You
can't do that with your original version because each sphere is a
separate blob object.
Alternatively, you could discard the blobs altogether and use the same
cos and sin waves to drive an isosurface function, which will give you a
perfectly smooth membrane that has exactly the same shape.
#declare F = function {y - 9*cos(x/3/8) - 3*sin(z/3/8)}
#declare Thickness=1.5;
isosurface {
function { abs(F(x,y,z)) - Thickness }
max_gradient 2
contained_by{box{<-36,-20,0><300,20,150>}}
pigment {rgb x}
finish { ambient 0.2 diffuse 0.8 phong 1 }
translate <10,-20,30>
}
If you want, you can put fake blobs back into the isosurface as follows.
The "x+z" and "z-x" bits rotate the fake blobs by 45 degrees, otherwise
the leopard pattern has a diagonal pattern.
camera {location <150,150,-150> look_at <150,50,0> }
background {rgb 1}
light_source {<-30, 100, -30> color rgb 1}
#declare F = function {y - 9*cos(x/3/8) - 3*sin(z/3/8)}
#declare Thickness=1.5;
#include "functions.inc"
isosurface {
function { abs(F(x,y,z)) - Thickness - f_leopard(x+z,0,z-x) }
max_gradient 2
contained_by{box{<-36,-20,0><300,20,150>}}
pigment {rgb x}
finish { ambient 0.2 diffuse 0.8 phong 1 }
translate <10,-20,30>
}
--
Mike Williams
Gentleman of Leisure
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Hi Mike,
Don't worry, it isn't a delay.
Thanks for your help. All understood now. I didn't know the leopard function
and I now I know it.
Regards,
Oleguer
news:J9lazIApnj$BFwVN@econym.demon.co.uk...
> Wasn't it Oleguer Vilella who wrote:
>>Hi Mike,
>>
>>Thanks for your help Mike, but that's not what I was looking for. I'm
>>traying to unify all the spheres to obtain an uniform membrane.
>
> Sorry for the late response. I've been unable to establish a link to the
> pov newsserver for a few days.
>
> Well, once you've got all the blob components in a single blob object
> you can adjust the threshold value, and the strength and radius of the
> individual blobs, and the separation between the blobs (like #local
> Fons=Fons+0.5), so that they blob together into a bumpy membrane. You
> can't do that with your original version because each sphere is a
> separate blob object.
>
> Alternatively, you could discard the blobs altogether and use the same
> cos and sin waves to drive an isosurface function, which will give you a
> perfectly smooth membrane that has exactly the same shape.
>
> #declare F = function {y - 9*cos(x/3/8) - 3*sin(z/3/8)}
>
> #declare Thickness=1.5;
>
> isosurface {
> function { abs(F(x,y,z)) - Thickness }
> max_gradient 2
> contained_by{box{<-36,-20,0><300,20,150>}}
> pigment {rgb x}
> finish { ambient 0.2 diffuse 0.8 phong 1 }
> translate <10,-20,30>
> }
>
>
> If you want, you can put fake blobs back into the isosurface as follows.
> The "x+z" and "z-x" bits rotate the fake blobs by 45 degrees, otherwise
> the leopard pattern has a diagonal pattern.
>
> camera {location <150,150,-150> look_at <150,50,0> }
> background {rgb 1}
> light_source {<-30, 100, -30> color rgb 1}
>
> #declare F = function {y - 9*cos(x/3/8) - 3*sin(z/3/8)}
>
> #declare Thickness=1.5;
>
> #include "functions.inc"
>
> isosurface {
> function { abs(F(x,y,z)) - Thickness - f_leopard(x+z,0,z-x) }
> max_gradient 2
> contained_by{box{<-36,-20,0><300,20,150>}}
> pigment {rgb x}
> finish { ambient 0.2 diffuse 0.8 phong 1 }
> translate <10,-20,30>
> }
>
>
>
> --
> Mike Williams
> Gentleman of Leisure
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
|
|