Particles on surfaces based off Camera projection
#1
I need to cover a scene with dots, from the camera's point of view.  Almost like how I would imagine raycasting would work, randomly shooting out from the camera.

It's a static effect,  but the camera sweeps over surfaces.  So i would just need to create them all on frame 0 and only have them be created/exist where the camera can see.  I tried camera cull, but it still has to make an insane number of them in the first place.

Currently i am using position object, but i have to add everything, and manually crank up the number so high it takes forever, and then only a small fraction of the total dots are even visible.  

Is there a more optimized way to handle this? 

I am thinking of something like having another creation validator on the position object like a checkbox that says, "only if visible to camera".

Insights appreciated,
-Joel


Attached Files Thumbnail(s)
   
Joel Eckert
Big Little Pictures
  Reply
#2
I would add all your scatter geometry to a single tyMesher (in "input geometry" mode), then use a Script operator to cast rays from your camera to each desired pixel, checking for hits on the tyMesher.

The easiest way to setup the raycasting would be to create a plane and orient it to the camera...offseting its position so that you can see it in the view and it perfectly fills the screen. Then set the plane segs to the resolution (so it has the same number of verts as the desired number of pixels). From there, use a Script operator to cast rays from the camera position to each vertex, and position a particle at the hit location if a hit is detected on the tyMesher. You can also scale the particles based on camera distance so they're all the same size in screen space.
  Reply
#3
That is pretty neat. Not sure I follow fully, but will try and see what happens.

I think i got what i was looking for more simple with position raycast! Didn't see that one!
Joel Eckert
Big Little Pictures
  Reply


Forum Jump: