ScriptSpot home

Forum topic · Scripts Wanted

How to scatter an object without intersections (Collision)

By obaida · 2011-12-22

Description

Hi .

Is there a script for scattering object(shape or geometry)depending on an object (shape or geometry)with random scale BUT without COLLISION .?

or how to do that .

Comments (11)
obaida

Right

Thank you miauu for your interest.
This is what I'm talking about , but instead of putting the values in X,Y,Z its better to have a button to pick an object and take the values ​​depending on the dimensions of it
and the possibility of apply it to 2d and 3d object .
thats all

miauu

Watch this video and tell me if that is what you want.

The freexed box(width=height=length = 200) represent "Scatter box" X, Y and Z dimension.

obaida

Thank you Miauu actually am not good in max script
so I'm waiting you ......

Reply to obaida
miauu

So, you want script that will do exactly what the GeneratoreDiCerchi do, or something else?

miauu

The code below will check for

The code below check for intersection between all objects in the scene:


--check for overlapping
allLPobj = objects as array				
for i = 1 to allLPobj.count do
(
							
        for j = i+1 to allLPobj.count do
	(
	   if (intersects allLPobj[i] allLPobj[j]) == true do
	   (
		-- scatter					   )
        )				
)

You can try the Explode function of RTTAssist.

P.S.If you want script like in the video and can't write it, I can do the job, but you have to wait the new year. :)

miauu

Loop through all objects and check for intersection of their boundingboxes with "intersect"(check maxscript reference), but this may be very slow on scene with many objects.

obaida

thank you for replay .
but am talkin about a script for doing that .
I saw video for lerning max script , I think it was spanish vedio
he was explainig a script called "GeneratoreDiCerchi" or something like that for scattering circle deppending on arectangle .
that's the point .

Panayot Karabakalov

or Scatter

Create panel > Geometry > Compound Objects > Scatter

kilad

you can use crowd