POV-Ray : Newsgroups : povray.newusers : #declared sphere in blob HELP Server Time
5 Nov 2024 11:20:30 EST (-0500)
  #declared sphere in blob HELP (Message 1 to 2 of 2)  
From: Maleko
Subject: #declared sphere in blob HELP
Date: 24 Jul 1999 18:50:15
Message: <379a4327@news.povray.org>
I am trying to use a #while looped sphere in a blob object. for some reason
it just won't work. Here is the code  ( i know it's ugly but I'm a moray
user trying to hand code)

declare R1 = seed(1297) ;
 #declare StrengthVal = 1.0
 #declare RadiusVal   = 1.0
#declare BallCount = 1 ;
#while (BallCount < 1000)

#declare raindrops =
 sphere
{
  <rand(R1)*15, rand(R1)*40,rand(R1),StrengthVal,RadiusVal>
  1
  translate <-7.5,-20,-1>
  material { water_tex1 }
  pigment {color rgb <1,1,1>}
  }
   #declare R1 = seed (R1+R1/1.2);
  #declare BallCount = BallCount+1 ;
#end

blob

 threshold .65
   raindrops <1,1,1,StrengthVal,RadiusVal> }


Post a reply to this message

From: Margus Ramst
Subject: Re: #declared sphere in blob HELP
Date: 24 Jul 1999 20:02:18
Message: <379A5409.1B6EFA87@peak.edu.ee>
You seem to be doing several things wrong.
1) The syntax of a spherical component is:
	sphere{<Center>, Radius, Strength}

2) Your "raindrops" is a declared object, while you try to reference it somewhat
like a macro in the blob body. Can't be done.

3) "raindrops" it is just the last sphere the #while generates, since the object
is simply redeclared with each loop.

I would go about it roughly like this (simplified version):

#declare S=seed(1121);
#declare Rad=1;
#declare Strength=1;
#declare Num=10;
#declare C=0;

blob{
threshold .75
#while (C < Num)
sphere{<rand(S),rand(S),rand(S)>, Rad, Strength}
#declare C=C+1;
#end
texture{whatever}
}


Post a reply to this message

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