POV-Ray : Newsgroups : povray.general : How to draw 1000 particles in 3D box... Server Time
29 Nov 2024 11:35:45 EST (-0500)
  How to draw 1000 particles in 3D box... (Message 1 to 4 of 4)  
From: James
Subject: How to draw 1000 particles in 3D box...
Date: 18 Nov 2005 20:10:01
Message: <web.437e7a91e2e1195ccce6fd2b0@news.povray.org>
I like to draw spheres of 1000 in 3D box. Is it possible with POV-ray?

I have 3-dimensional positions of spheres. How, I don't know how to put the
positions of spheres of 1000 on the program. As you know, it is difficult
to manually put position of each sphere on the program.

Thank you in advance.


Post a reply to this message

From: Slime
Subject: Re: How to draw 1000 particles in 3D box...
Date: 18 Nov 2005 23:30:28
Message: <437eaa64@news.povray.org>
> I like to draw spheres of 1000 in 3D box. Is it possible with POV-ray?

Yes.

> I have 3-dimensional positions of spheres.

If you already have their positions, your best bet is to write them out to a
text file in a format like

<1,2,3>,<4,5,6>,...

(comma separated vectors). Then you can use the #fopen and #read directives
(look them up in the documentation for details) to read and use the given
positions.

If randomly generated positions will do, that would be easier as you don't
need to use an external file.

 - Slime
 [ http://www.slimeland.com/ ]


Post a reply to this message

From: Alain
Subject: Re: How to draw 1000 particles in 3D box...
Date: 19 Nov 2005 10:58:40
Message: <437f4bb0$1@news.povray.org>
James nous apporta ses lumieres en ce 2005-11-18 20:06:
> I like to draw spheres of 1000 in 3D box. Is it possible with POV-ray?
> 
> I have 3-dimensional positions of spheres. How, I don't know how to put the
> positions of spheres of 1000 on the program. As you know, it is difficult
> to manually put position of each sphere on the program.
> 
> Thank you in advance.
> 
> 
> 
> 
If the exact position is not importent and all the particles use a relatively small
percentage of 
the volume.
Use a while loop to randomly place all your small spheres.
If the positions of your spheres are from a file, you can use Slime's proposition.
You still use a while loop to read the positions from the file and create all the
spheres. If all 
the spheres share the same texture, your better to wrap them all in an union and apply
that texture 
to the whole union. It will use a lot less memory that way: 1 texture deffinition
instead of 1000.

-- 
Alain
-------------------------------------------------
Communism: It's everybody's shit.


Post a reply to this message

From: Tom Austin
Subject: Re: How to draw 1000 particles in 3D box...
Date: 22 Nov 2005 08:53:17
Message: <438322cd$1@news.povray.org>
James wrote:
> I like to draw spheres of 1000 in 3D box. Is it possible with POV-ray?
> 
> I have 3-dimensional positions of spheres. How, I don't know how to put the
> positions of spheres of 1000 on the program. As you know, it is difficult
> to manually put position of each sphere on the program.
> 
> Thank you in advance.
> 
> 
> 
> 

If you want to put the spheres in in a grid, just use a loop and 
variables for the position.  Look up looping in the documentation.


Tom


Post a reply to this message

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