POV-Ray : Newsgroups : povray.animations : How to enquiry : Re: How to enquiry Server Time
30 Nov 2022 05:40:26 EST (-0500)
  Re: How to enquiry  
From: Dick Balaska
Date: 27 Oct 2022 17:10:22
Message: <635af3be$1@news.povray.org>
On 10/27/2022 11:11, Le_Forgeron wrote:
> Le 19/10/2022 à 18:38, santividal a écrit :
>> Him I am trying to replicate this water droplets all around the tap 
>> -see the
>> image attached-, so maybe a series of droplets every 12 or 24 degrees 
>> around z
>> axis. How should I do that? I know it is a beginner trick, but I am 
>> trying
>> different #while sentences and it doesn't seem to work out. Could 
>> somebody help
>> me? Here is the code I am using to achieve the droplets look like a 
>> trajectory.
>>
>> Thanks in advance for any help,
>>
>>
> 
> #for( kk, 0, 359, 12)
> 
>> // FUENTE SUPERIOR
>>
>> #declare posX = 0.02;
>> #declare posY = 0.82;
>> #declare dy = 0.055;
>> #declare posZ=0;
>> #declare posZ= <0,0,posZ+12>;
>>
>>
>>      #while (posX < 0.3)
>>      sphere {
	posX*x, 0.01
// >>      <posX,posY,0>, 0.01
> 
> 	rotate kk*vertical_axis
	translate posZ*z
> 
>>      material { agua }  }
>>      #declare dy = dy - 0.01;
>>      #declare posX = posX + 0.02;
>>      #declare posY = (posY + dy);
>>      #end
>>
> 
> #end
> 

You want to work with your object at the origin (<0,0,0>), manipulate 
it, then translate it to it's final position. I think you are assuming 
that the fountain stem is at <0,0,0>. What if you move it?  SO here, 
what you really want to do is define a max radius for your circle sweep.

#local maxRad = 0.3;
#declare FountainSpray=
union {
     #local dy = 0.055;
     #local YY = 0.82;
     #for (MR, 0.02, maxRad, 0.02)
         #for (KK, 0, 359, 12)
             sphere {
                 MR*x, 0.01
                 rotate KK*y
                 translate YY*y
             }
         #end
         #local dy = dy-0.01;
         #local YY = (YY+dy);
     #end
//    material {agua}
     material{ texture { Glass3  } // end of texture
               interior{ I_Glass } // end of interior
             } // end of material -------------------

}

#declare FountainPos = <0,0,0>;
object {FountainSpray translate FountainPos}


Post a reply to this message


Attachments:
Download 'test.png' (93 KB)

Preview of image 'test.png'
test.png


 

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