POV-Ray : Newsgroups : povray.newusers : Spheres in a sphere : Re: Spheres in a sphere Server Time
14 May 2024 09:18:23 EDT (-0400)
  Re: Spheres in a sphere  
From: nonostar
Date: 24 Mar 2014 10:05:01
Message: <web.53303aad9f83cd68419a77410@news.povray.org>
I tried to improve this.

But i get a problem.
When i ran i had this message : "Attempt to access unitialized array elemement"
for this line :

 #declare Point=ArrayPosition[Variable2];


i give you my code.

#include "rand.inc"
#declare Random_1 = seed (12433);
#declare ArrayPosition=array[3000]
#declare ArrayRayon=array[3000]
#declare Variable=0;

#while (Variable<30)
        #declare ArrayPosition[Variable]=VRand_In_Sphere(Random_1);
        #declare ArrayRayon[Variable]=0.05;
        #declare Variable=Variable+1;
#end

#declare Variable1=0;
#declare Variable2=1;

#declare Object=sphere{ArrayPosition[Variable1] ArrayRayon[Variable1] pigment
{rgb <1,1,0>}};
#declare Point=ArrayPosition[Variable2];

#while (Variable2<3000)
        #while (Variable1<Variable2)
                #if(inside(Object,Point))
                #declare ArrayRayon[Variable2]=0;
                #declare Variable1=Variable2;
                #else
                #declare Variable1=Variable1+1;
                #declare Object=sphere{ArrayPosition[Variable1]
ArrayRayon[Variable1] pigment {rgb <1,1,0>}};
                #end
        #end
        #declare Variable2=(Variable2+1);
        #declare Variable1=0;
        #declare Object=sphere{ArrayPosition[Variable1] ArrayRayon[Variable1]
pigment {rgb <1,1,0>}};
        #declare Point=ArrayPosition[Variable2];

#end

#declare Variable=0;
#while (Variable<3000)
sphere{ArrayPosition[Variable] ArrayRayon[Variable] pigment {rgb <1,1,0>}}
#declare Variable=Variable+1;
#end


where is the mistake ?

I don't understand.

Thanks for your help


Post a reply to this message

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