Thursday, March 3, 2011

Interactions, tweaks and start of implicitness

So as this week has involved scrabbling to complete movies, midterms, and smoke simulations, and general lack of what we might consider necessary doses of sleep, overall it was not extremely productive week on the senior project front.  Also, as I am currently finishing this blog post at a resort, I am paying dearly for internet/computer access right now, so I will keep this pretty brief.  I am still working on adding in user interaction to my GUI, which is proving more difficult than anticipated due to my simple camera implementation (which is just using the glTranslate and glRotate methods right now).  I am thinking of upgrading my camera class so that I can use gluLookAt instead of relying on rotating the world ' this will make shooting rays and picking objects much easier since I will have the eye position already stored.  For now, I am thinking of just the click drag -> apply force in that direction schema, which should integrate in nicely with my framework.  Later, if there´s time, I can use the rigid bodies class I added into the framework to be able to have a "virtual tool" for interacting with the mercury (see the interaction tool buttons on my GUI), but I´m thinking I might just make this an option for haptics anyway.  In terms of speeding up the simulation, I think choosing a better hash function for my spatial hashing data structure should help.   Other smaller improvements to my program I´m working on:
  • Adding in more parameters to the GUI and actually having slots to make the simulation respond to changing the parameters.  The ones I´m adding (right now these are all just predefined constants):
    • k - the pressure constant for computing pressure
    • k_near - the near pressure constant for near pressure (increasing this causes less clustering by repelling ver close particles)
    • k_spring - the spring constant for springs between particles
    • gamma - elasticity constant
    • alpha - plasticity constant
    • sigma - linear viscosity term  
    • mu - friction term between particles and rigid bodies
    • rho_0 ' the rest or desired density of the particles
      • these all mostly come from the Clavet paper
      • while some of these parameters will proably not be in the final version of the application, I think it will be very useful to be able to experiment with teaking different parameters in real time and will make the program more dynamic.  Allowing the user to change the particle color should also be pretty trivial.
  • Adding a framework tracker to get a read on the exact framerate - will be helpful in quantifying performance and tyring to get a read on the exact framerate - will be helpful in quantifying performance and trying to get a speedup (I think for simplicity I might just adapt the one from the CIS563 base code - the mmc::FpsTracker class)
On to the next part of the project, implicit formulation and surface reconstruction, I am currently thinking of formulating the surface as something like:

f(x) = bias - sum(for each particle i)<exp(-abs(x-c)/(s) )> //sorry that´s illegible, I´m using a spanish keyboard

where c is the location of the particle and s is a standard devation for the particle.  I am going to start by tyring to construct the surface using the open source marching cubes algorithm and see what sort of visualization adn framerate I get on that to start.  Then I will look to the other possible methods for surface reconstruction (Witkin floter particle constrain method, etc.) I´ve been scrounging the web for other possible approaches that might work.  Anyhow, that´s all for now.  When I return from my vacation I will be hopefully much more well rested and ready to start on some implicit surface reconstruction!

2 comments:

  1. gluLookAt is definitely the way to go. It made a huge different in the turnover time/amount of boilerplate code that me/my team had to write in MiniMaya :-)

    ReplyDelete
  2. I actually use this very nice matrix library: GLM to handle the camera transformations

    http://www.g-truc.net/project-0016.html#menu

    http://glm.g-truc.net/html/index.html

    ReplyDelete