Jump to content

Point cloud in Pop ?


superdjo

Recommended Posts

Hello,

I'm currently writing a vex node for pops and I need to iterate through the current points to fetch attributes on them given a distance.

Currently i'm using a brute force method using a for(int i=0;i<Npt;i++) and calculating the distance between the current point poisition and the other point position.

which can be pretty slow given a good amount of particles.

So I thought hey why not use point clouds but I'm not very familiar with them. So I've been looking through the forum in search of any clues.

Anyway it's seems pretty straightforward to use. Using point cloud files in the point cloud string parameter works fine but my problem is that I do not wish to use files as it is an interactive simulation. so I tried op:/path/to/my/vex/pop/s/input in the string parameter as I was told it should work and this fails and can't figure out why ?

Any ideas using point clouds in pop using op: in the parameter ?

Link to comment
Share on other sites

  • 2 weeks later...
Do you need to process in POPs? If there's no need to, you should do it in SOPs and you can use point clouds.

Cheers!

steven

actually yes I do need to do it in POPs as my code acts on the particles simulation.

Anyway got it to work using a for loop and checking each one of them, it was just to speed up the processing time that's all

anyway thanx all, I'll post what I'm doing in some time soon

Link to comment
Share on other sites

There are ways to use point clouds with particles. It requires you writing out the particle point cloud for each timestep in the particle sim. Then read the previous frame's geo as a point cloud and index in to that. Not a clean solution but it does work.

Link to comment
Share on other sites

  • 9 months later...

There are ways to use point clouds with particles. It requires you writing out the particle point cloud for each timestep in the particle sim. Then read the previous frame's geo as a point cloud and index in to that. Not a clean solution but it does work.

Sorry to dredge up an old post, but could anyone enlighten me on how to do this? It'd be mighty useful to have access to the previous completed timestep of a particle sim as a pointcloud. Is this something I could do using point cloud export, or would it need to be cached in some way as a SOP, and read back in?

Link to comment
Share on other sites

Sorry to dredge up an old post, but could anyone enlighten me on how to do this? It'd be mighty useful to have access to the previous completed timestep of a particle sim as a pointcloud. Is this something I could do using point cloud export, or would it need to be cached in some way as a SOP, and read back in?

A popsolver in dops will attach geometry to your pops. The problem why you can not read in the particles with a pointcloud in pops is because they are not associated with geometry in the pop context. By pulling them through dops with a popsolver you are attaching geometry to them. You can then use this geometry to read in your pointcloud with your "op:" command.

(And you can now also scrub your particles in the timeline which is nice :) ).

If you take it further you can almost recreate all pop operators in sops with vex and pointclouds and use a sopsolver with a bunch of initial points. This is really fast if you have a lot of procs as the pointclouds are multithreaded.

If you use a popsolver rather then a sopsolver you can use both pops and sops as if they were pop operators. Really fun stuff - try it with a magnet... or magnet on all your points and you have an "interact pop". At the moment not very many sops are multithreaded so if you can do it in vex with pointclouds it is worth it as the speed gain can be really huge.

Link to comment
Share on other sites

A popsolver in dops will attach geometry to your pops. The problem why you can not read in the particles with a pointcloud in pops is because they are not associated with geometry in the pop context. By pulling them through dops with a popsolver you are attaching geometry to them. You can then use this geometry to read in your pointcloud with your "op:" command.

(And you can now also scrub your particles in the timeline which is nice :) ).

If you take it further you can almost recreate all pop operators in sops with vex and pointclouds and use a sopsolver with a bunch of initial points. This is really fast if you have a lot of procs as the pointclouds are multithreaded.

If you use a popsolver rather then a sopsolver you can use both pops and sops as if they were pop operators. Really fun stuff - try it with a magnet... or magnet on all your points and you have an "interact pop". At the moment not very many sops are multithreaded so if you can do it in vex with pointclouds it is worth it as the speed gain can be really huge.

Ah, many interesting avenues to explore. Thanks for all that! So far I'm only just scratching the surface of Houdini, everything is SOPs POPs and VOP-*OPs at the moment. Gonna have to start venturing out into new ground methinks :-)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...