Notifications
Clear all

[Closed] randomly placing objects in a scene but with a little difference

Hi2all

I am posting this to see if anyone has a solution or sugestion on how to randomly place objects in a scene, the difference is that the area in which the elements are to be placed in the yellow area marked in the following image ::

the link for the MAX file is :

http://www.tzero.org/cgtalk/_cgtalk__site.max

The trick is that is not only for this map, the script has to be flexible enough to be applied into different maps. It would be nice if the script could work in 3D maps too, not only in plane maps such as this one.

Hope someone can give me a hint on how to do this.

Fabiano Friedrich

6 Replies

EDIT: I was able to open your file (I only have Max6) and the solution doesn’t require
scripting at all.

Apply and EDIT MESH to your shape and use as a Position Object in Particle Flow, set to
vertex option, and add the shape instances of your choice!

Enjoy!

Sorry i am a bit unfamiliar with the particle system in max and therefore did not really understand your reply. I managed to make it edit mesh and got to “event02 Position Object 1” but didn’t fina place to apply, say a Box, to the emitter. Should it be a PF Source?

oh, ok I see (drag and drop).
thx man it kinda solves the problem, but although its a random placing, it it limited the number of vertexes in the mesh, so the probability of more particles been assigned to the more heavily vertexed part of the mesh, is greater.
Nevertheless, its a nice trick and I will definetly script it.

THANK YOU VERY MUCH!!

ALL DONE
now to create a box in every particle position…

pf = PF Source 01'
  
  for i in 1 to pf.numparticles() do
  (pf.particleIndex = i
  pf.particleSelected = true
  ppos = pf.particlePosition
  box pos:pos
  )

Not much point scripting it really… just use the PFlow parameters to grab geometry.
Add a Shape Instance operator, and select any geometry you want to put in place of the particles. Then you’re free to start rotating, scaling, changing materials etc using other operators.

Also, use Volume, instead of Vertex to spread the particles out more naturally.