|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Hi All
when I run the following code not only do I get 100 spheres but as the code
loops it also draws the slab a hundred times or so.
Can anyone suggest a way of using trace in a way that the object is only
drawn once? Otherwise the memory hit with high samples is horrendous!
Mick
===================================================
#version 3.1;//Superpatch
#include "colors.inc"
// ----------------------------------------
camera
{
location <0.0, 10, -20.0>
direction 1.5*z
right 4/3*x
look_at <0.0, 0.0, 0.0>
}
sky_sphere
{
pigment
{
gradient y
color_map { [0.0 color blue 0.6] [1.0 color rgb 1] }
}
}
light_source{<-30, 30, -30>,color rgb<1,1,1>}
// ----------------------------------------
#declare Step2 = box{<-2, 0, -2>< 2, .4, 2> pigment{Yellow}}
#declare Norm = <0,0,0>;
#declare Xpos = -5;
#declare Zpos = 5;
#while (Xpos<6)
#while (Zpos>-6)
#declare SPos = <Xpos,1,Zpos>;
#declare Inter = trace (Step2,SPos,<0,0,0>-SPos, Norm );
object{Step2 texture {pigment{color rgb<1,1,0>}}}
#if (Norm.x != 0 | Norm.y != 0 | Norm.z != 0)
sphere{Inter,.1 texture{pigment{color red
1}}}
#end
#declare Zpos = Zpos -1;
#end
#declare Zpos = 5;
#declare Xpos = Xpos +1;
#end
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On Tue, 6 Apr 1999 17:50:18 +0100, Mick Hazelgrove wrote:
>Hi All
>
>when I run the following code not only do I get 100 spheres but as the code
>loops it also draws the slab a hundred times or so.
>Can anyone suggest a way of using trace in a way that the object is only
>drawn once? Otherwise the memory hit with high samples is horrendous!
Could you just move the "object {step2..." line outside the while loop?
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Thanks Ron
That does it
Now how can I use trace to test the height of a HF... Hmmmm
Mick
Ron Parker <par### [at] my-dejanewscom> wrote in message
news:370a4264.0@news.povray.org...
> On Tue, 6 Apr 1999 17:50:18 +0100, Mick Hazelgrove wrote:
> >Hi All
> >
> >when I run the following code not only do I get 100 spheres but as the
code
> >loops it also draws the slab a hundred times or so.
> >Can anyone suggest a way of using trace in a way that the object is only
> >drawn once? Otherwise the memory hit with high samples is horrendous!
>
> Could you just move the "object {step2..." line outside the while loop?
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Mick Hazelgrove wrote:
>
> Thanks Ron
>
> That does it
>
> Now how can I use trace to test the height of a HF... Hmmmm
>
> Mick
It's quite simple actually
#declare your heigtfield (eg. #declare HF=heightfield{...})
#declare the maximum height of the heightfield (#declare MaxHeight=(the
y-scale of the hf + 1)
then when you want to know the heigth at point (x,z)
just trace(HF,<x,MaxHeight,z>,<0,-1,0>)
I did this straight from my memory so there might be some errors but
hopefully you get the main idea
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Why not simply trace from below, e.g. trace(HF,<Px,-1,Pz>,y)
Margus
>
>It's quite simple actually
>
>#declare your heigtfield (eg. #declare HF=heightfield{...})
>#declare the maximum height of the heightfield (#declare MaxHeight=(the
>y-scale of the hf + 1)
>then when you want to know the heigth at point (x,z)
>just trace(HF,<x,MaxHeight,z>,<0,-1,0>)
>
>I did this straight from my memory so there might be some errors but
>hopefully you get the main idea
>
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Mick Hazelgrove <mha### [at] mindaswinternetcouk> schrieb in im Newsbeitrag:
370a3e82.0@news.povray.org...
> Hi All
>
> when I run the following code not only do I get 100 spheres but as the
code
> loops it also draws the slab a hundred times or so.
> Can anyone suggest a way of using trace in a way that the object is only
> drawn once? Otherwise the memory hit with high samples is horrendous!
>
> Mick
>
> ===================================================
>
> #version 3.1;//Superpatch
>
> #include "colors.inc"
>
> // ----------------------------------------
> camera
> {
> location <0.0, 10, -20.0>
> direction 1.5*z
> right 4/3*x
> look_at <0.0, 0.0, 0.0>
> }
>
> sky_sphere
> {
> pigment
> {
> gradient y
> color_map { [0.0 color blue 0.6] [1.0 color rgb 1] }
> }
> }
>
> light_source{<-30, 30, -30>,color rgb<1,1,1>}
>
> // ----------------------------------------
>
> #declare Step2 = box{<-2, 0, -2>< 2, .4, 2> pigment{Yellow}}
>
> #declare Norm = <0,0,0>;
> #declare Xpos = -5;
> #declare Zpos = 5;
>
>
> #while (Xpos<6)
>
> #while (Zpos>-6)
>
> #declare SPos = <Xpos,1,Zpos>;
>
> #declare Inter = trace (Step2,SPos,<0,0,0>-SPos, Norm );
>
> object{Step2 texture {pigment{color rgb<1,1,0>}}}
> #if (Norm.x != 0 | Norm.y != 0 | Norm.z != 0)
> sphere{Inter,.1 texture{pigment{color red
> 1}}}
> #end
> #declare Zpos = Zpos -1;
> #end
> #declare Zpos = 5;
> #declare Xpos = Xpos +1;
>
> #end
>
>
looks like a macro defined somewhere else!
Hm would be nice if you could make me wiser!
Smarf
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On Wed, 14 Apr 1999 21:55:15 +0200, Matthias <sma### [at] t-onlinede> wrote:
>looks like a macro defined somewhere else!
>Hm would be nice if you could make me wiser!
Trace isn't a macro, it's a function that exists only in the Superpatch,
available at http://twysted.net/patchstation . It is used to find the
intersection of an arbitrary ray with an arbitrary object and is useful
for such things as placing objects on height fields or growing creeping
ivy in POV scripts.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Hi
There you go - I couldn't of put it better if I'd written the superpatch:)
Mick
Matthias <sma### [at] t-onlinede> wrote:
> >looks like a macro defined somewhere else!
> >Hm would be nice if you could make me wiser!
>
> Trace isn't a macro, it's a function that exists only in the Superpatch,
> available at http://twysted.net/patchstation . It is used to find the
> intersection of an arbitrary ray with an arbitrary object and is useful
> for such things as placing objects on height fields or growing creeping
> ivy in POV scripts.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
|
|