POV-Ray : Newsgroups : povray.general : Stacking Balls : Re: Stacking Balls Server Time
16 Nov 2024 11:16:18 EST (-0500)
  Re: Stacking Balls  
From: K  Tyler
Date: 22 Aug 1998 03:31:40
Message: <35DE5764.4CCFA44A@pacbell.net>
Chris Maryan wrote:

> I've noticed a number of cool looking images rendered in POVRay that
> involve balls/marbles/whatever stacket to look like a random pile (most
> notably the image that's on the POVRay 3.02 splash screen). Each of
> these images looks like the objects do not intersect but just touch. How
> is this usually done? Should I do the math (seems complicated) or is the
> only way to just guess and test-render? Maybe someone has a script?
> Maybe I am missing the obvious and should just read the docs again?
>
> Any help would be appreciated.
> Chris Maryan
> mailto:cma### [at] geocitiescom
> My ideas are free,
> Work is at least minimum wage.



> Email me if you are interested in donating
> to the Chris Maryan needs money fund.

  Please Add me to this list.


---------
  Take a look at the while loop function described in the docs.
It's certainly not the only method but can save a lot of typing
and rendering time. There are also modelers that have a copy
and translate function. One that has this function is PovCad.
You can choose say a sphere for example and then choose the
copy and translate function. A window will pop up asking the
distance to translate, which direction, and the number of copies
desired. It's a pretty handy tool.

Here is an example of a while loop.

camera{location<0,0,-20>look_at 0}
light_source{<0,0,-100>rgb 1}

#declare Count = 0
#while  ( Count < 10 )
sphere{<0,0,0>,1 pigment{rgb 1} translate<-9+Count*2, 0, 0>}
#declare Count = Count+1
#end

This will place ten spheres 5 left and 5 right centered on the screen.
Each touching but not over lapping each other. This also a great
function to accurately crate and rotate a large number of objects.
It certainly bears playing around with for a while to see what it
can do for you.

Happy rendering !

K.Tyler


Post a reply to this message

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