Showing posts with label openFrameworks. Show all posts
Showing posts with label openFrameworks. Show all posts

Sunday, August 11, 2013

Psys demo 2: Location Emitter and Mesh Emission

So i fiddled around a bit more with the idea of having attributes but decided against it.
It added a lot of complexity and work-arounds into the mix and seemed like an overkill
for now.


Here's another video showing a comparison between location emitters and Mesh emissions.

Psys: demo 2: Location Emitter and Mesh Emitters from bhavesh pandey on Vimeo.


So for now I have decided to focus more efforts on implementing Ray-Triangle intersection
routines for the particles and hopefully implementing an accelerated data structure for fast neighbour
lookups (but nothing too elaborate).
Maybe another weekend.




Saturday, August 10, 2013

Psys demo 1: AABB

Ok, so I have added a kill() routine as well as another routine to compute an
Axis Aligned Bounding Box for the Particle system along with another routine to
draw this AABB.

Psys demo 1: AABB from bhavesh pandey on Vimeo.

Now, I would quite like to implement 2 more things into this.
1) Ray / Intersection capabilities akin to Houdini's Ray SOP for basic collision detection etc.
2) An accelerated data structure for fast neighbour lookups.

After this I'm pretty sure I'll have most of the things I'll need for the time ( :D )
I would like to spend some  time cleaning the code and then profiling + optimising it further
along with some other projects I have in mind.

Will post another update later..

Ciao.

Wednesday, August 7, 2013

Psys..particle system library

Well, so I have been tinkering with the idea of creating my own particle system library (yes..yet another library for particles! but I intend to try and implement it a bit more like Houdini's pops..or rather I'm hoping to!!) to be used with OF as a personal project. Also I like the idea of developing something I will be comfortable using knowing that it tries to be consistent with the way Houdini works (i.e with respect to the workflow) and I can use as a base for other projects I will be undertaking later on.

Well so here's how the design goes (very rough and brief):

There's a ParticleSystem which contains emitters. It can have any arbitrary number of
emitters in it which is setup by the user.
Emitters are only used to emit into the  ParticleSystem. They do not manage
or care about particles only about how particles get emitted, their initial velocities
initial positions etc.
Kind of like Houdini's Location/Source pops inside the POP context which can have any number of emitters in it and all the emitters care about is Emission of Particles.
To keep things simple I have not yet implemented any deletions or killing
of particles but its kind of inevitable.

Also I have taken care to make it such that the result is always reproducible
using same seed values (which does take some extra steps).
At the moment there are 2 emitter types supported.

  1. Emitters akin to Location POP: They have controls for defining initial position of particles and intital velocities. As well as an activation flag which can be turned off to stop the given emitter and a jitter scale which just adds in some jitter.
  2. Emitters akin to Source POP:    These use any triangulated mesh and emit particles from it. Theres support for inheriting colors from the mesh as well along with all the other features of the former type.
I've also designed a templated Attribute class for these but they are proving a bit tricky with all the different value types. One idea is to have pre-defined vectors to hold each value typed attribute
etc and push each attrib in relevant vectors.
and then set/get using specialized templated procedures.

But I'm still trying to get to a better solution for this.

Anyways this is a screenshot from what I have been able to get so far:
(Most of you should recall the openVDB dragon!)












The particles here are emitted from a base mesh with colors set on it.
The Emitter class just detects if the base mesh has any colors and if it does
it inherits it.
The particle have a basic perlin noise applied on them as a force and thats about it.

I intend to implement the killing procedures and then it would more or less have
what I'll need for the time being.

Tuesday, August 17, 2010

particles using OpenFrameworks






Hey....so I was just fiddling with openFrameworks and finally I have something crappy which I could put
up online :D
This is just a rough test of a very basic Particle system, I did just to make myself comfortable with programming using OpenFrameworks....
Total number of particles = 50000..
Ok, i did work quite a bit to get something as crappy as this....so be warned of how crappy it could have been
had I put in my 100% of crappyness :P
Yea..I get it..I got a real bad sense of tumor....errrr humor....or so I have been told..anyways..

I found it very much analogous to working with Houdini..
Houdini ==> Create an Emitter, Set the Parameters for Particles.. ie. Life, color, spee, position etc..
and then copy spheres or circles to those Points....simple :)

OpenFrameworks ==> Create a Emitter Class, a Particle class....initialize and set the values of variables used.....write a main() funtion to start the application..thats about it....I had position data in an array....so finally i just created circles using the x,y position data at draw time....(which is analogous to copying circles to points!)

before amnesia kicks in allow me to put some images....(video would have been cooler...but screencapture's not working..)

finally I managed to get OpenFrameworks to write out each frame to an image sequence before drawing anything....I then stitched them together using ffmpeg..
here's it goes :)


I think if I could come up with some nice interactivity using OpenFrameworks with Houdini, it would be pure awesomeness!

gotta test more.....