PDA

View Full Version : Particle Flow / aligning cubes on surface


redesigner
05-17-2008, 07:02 PM
Hey folks,

i want to transform one object (editable poly) into another using 25x25x25cm-cubes as particles. The cubes should dock onto the surface of the target object, and cover it's 3-dimensional surface completely and not overlap one another. I could solve this problem using particle flow with the particles docking onto the vertices (find target & position object operator) of the target object, but then I need to retopologize my target objects and that would take too much time. Is there an alternative way of performing this function in order that the cubes automatically align themselves to the surface area of the object?

Thank you in advance

Tobi

Bobo
05-19-2008, 05:06 AM
Hey folks,

i want to transform one object (editable poly) into another using 25x25x25cm-cubes as particles. The cubes should dock onto the surface of the target object, and cover it's 3-dimensional surface completely and not overlap one another. I could solve this problem using particle flow with the particles docking onto the vertices (find target & position object operator) of the target object, but then I need to retopologize my target objects and that would take too much time. Is there an alternative way of performing this function in order that the cubes automatically align themselves to the surface area of the object?

Thank you in advance

Tobi

The standard way of doing this is reading the target positions and storing them into the Script Vector Channel via a Script Operator or a Box #3 DataOp.
Then, set the Find Target to "By Script Vector" and the particles will fly to those positions. If the stored values are in World Space, you don't even have to specify a Mesh in the Find Target test. If the Target object is moving though, you can pass the values to the Script Vector Channel in object space and select the object in the Find Target test. If you would move the target mesh node, the particles will still dock correctly because they would use the object space coordinates, no matter where in the world that object is.

PsychoSilence
05-19-2008, 01:52 PM
i was always wondering how it works correctly with moving target objects...and scripts are really the bottle neck of a particle system :(

redesigner
05-20-2008, 10:48 AM
The standard way of doing this is reading the target positions and storing them into the Script Vector Channel via a Script Operator or a Box #3 DataOp.
Then, set the Find Target to "By Script Vector" and the particles will fly to those positions. If the stored values are in World Space, you don't even have to specify a Mesh in the Find Target test. If the Target object is moving though, you can pass the values to the Script Vector Channel in object space and select the object in the Find Target test. If you would move the target mesh node, the particles will still dock correctly because they would use the object space coordinates, no matter where in the world that object is.

Bobo, thanks for your answer! That's the way I already tried, but I need the particles to arrange in a 3d-grid with 25x25x25 spacing. I have attached some pictures to show the problem:

http://www.redesigner.tv/temp/particle_align_example_geometry.jpg

http://www.redesigner.tv/temp/particle_align_example_scattered_boxes.jpg

I have found a workaround now, I have positioned boxes (25x25x25) manually as objects around the surface of my target object. Then I have set the size of the boxes to zero in xyz and collapsed them as a mesh. After converting this to an editable poly, I have welded the vertices (eight vertices per box became one), so I can use this vertices as docking points for particle flow. But: the problem now is, that my source object consists of 1560 vertices, and my target object has 2345 vertices. How can I tell particle flow, to cover every vertex on the object and not twice (what I get with some particles right now) and to change the amount of particles from 1560 to 2345 over time?

mhinks
05-21-2008, 04:03 PM
I need to do a similar task with Pflow. I need to have a 60 particles to appear and fly off and fix on to specific vertex points on an object. The problem I have is currently I cant get only one particle to go to one vertex, and also I have no idea what to write in the script operator to do the method you discribe.

Any chance you can help me out?

redesigner
05-23-2008, 11:04 AM
I need to do a similar task with Pflow. I need to have a 60 particles to appear and fly off and fix on to specific vertex points on an object. The problem I have is currently I cant get only one particle to go to one vertex, and also I have no idea what to write in the script operator to do the method you discribe.

Any chance you can help me out?

Hi mhinks!

There is a good video-tutorial by Allan Mckay on his website: http://www.allanmckay.com/tut/tut_ObjAB.avi

mhinks
05-23-2008, 12:57 PM
That video was v good but....! I've used the below code.


on ChannelsUsed pCont do
(
pCont.useVector = true
pCont.usePosition = true
--pCont.useRotation = true
)

on Init pCont do
(

)

on Proceed pCont do
(
count = pCont.NumParticles()


for i in 1 to count do
(
pCont.particleIndex = i
pCont.particleVector = pCont.ParticlePosition;

)
)


This works, but the z heights not not correctly getting sorted, and the are going to the correct places, but all slighty offset. Very strange.

Does anyone notice something wrong?

CGTalk Moderation
05-23-2008, 12:57 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.