Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

162 Neutral

About GameLad

  • Rank

Personal Information

  • Interests

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Yeah thanks,.that should work. And I just found out how to find W with no issues.
  2. I have a position in space called X1. X1 has a velocity called V1. I need to construct an orthogonal plane perpendicular to the velocity vector. The origin of the plane is X1. I need to turn the two edges from the plane into two vectors, E1 and E2. The edges connect at the origin. So the three vectors form an axis
  3. GameLad

    Eigen Value of Gradient of a vector

    I'm trying to calculate a scalar field for marching cubes based on an equation in this paper https://www.researchgate.net/publication/220357083_A_unified_particle_model_for_fluid-solid_interactions. I need to find the biggest Eigen value efficiently. It says the gradient of a vector. Because of curvature, some grid points in the field maybe moving faster than the point being sampled. So need to need Eigen values to correct this.
  4. How does the gradient of a vector(delta V) become a 3x3 matrix? And how do you compute it's eigen value efficiently? Is there c++ library that can do this (can the c++ library Eigen do this
  5. GameLad

    Position Based Fluids smoke and fire

    I forgot to update this thread, I managed to find the problem, I forgot to set external forces to zero at the beginning of every step. Here is the result. I'm using a different boundary method that uses a precalculated weight to create a pressure force that prevents particles from penetrating. Thanks for the help, much appreciated.
  6. GameLad

    Position Based Fluids smoke and fire

    So decided to not use Position Based Fluids, I switched to SPH. I have a working SPH simulation in 2D. When the particles are in motion everything works fine. But once the simulation comes to a rest particles at the bottom begin to oscillate violently and eventually penetrate the boundary particles. I have tried dampening the simulation with two types of viscosity, XSPH and Artificial viscosity. They only helped slightly. Smaller time steps don't help either. Obviously pressures are building at the bottom. Is there another way to do fix this apart from viscosity and smaller timesteps? After trying different things I don't think the boundary is the issue because if I increase/decrease the boundary inter particle spacing, nothing happens. The oscillations happen mainly horizontally.
  7. GameLad

    Position Based Fluids smoke and fire

    To fully answer my own question, and to help anyone who may have a similar question. The answer is yes it is possible. Look for Unified Particle Physics for Real-Time Applications.
  8. Rigid bodies are possible, I got it working. A few other steps can be taken to fix your problems.
  9. I can't answer your questions about the library but I can share my knowledge of the Position based dynamics paper. While the particles that represent the rigid body dynamics have a velocity attribute, the gauss-sidel iterations work directly with positions. For example a distance constraint is defined as C(p1,p2) = |p1 - p2| - rest_distance = 0. So you have to find a corrective value that will enforce the constraint. Like so C(P + delta_p) = 0. This is a short hand for saying find a value for value for p1 and p2 (p1 and 2 because the cardinality of the distance constraint is two particles), that when added to the predicted position (more on that in a minute) will move the particles into the correct place. The paper mostly talks about the framework used for all PBD, and it gives examples. To implement look at the final form of the constraint where you find delta p (the cardinality of the constraint determines how many deltas or corrective values you will need to solve that constraint. The distance constraint has two values for example). I don't completely understand how the final constraints equations are derived but I have a rough idea why. In order to solve the constraint numerically using iterative methods (gauss-sidel and jacobi if you want to go parallel) first the Taylor seris is applied to the constraint equation to get its first order form (first derivative), then optimisation (the lambda) is performed to get a scaling value. The scaling value is important because it pushes the corrections into the right direction. Something about manifolds which I don't completely get. So the bigger picture is this. Iterative methods work better if your initial value is closer to actual solution. So if you look at the algorithm in the paper at the beginning at the main loop you will see velocities and a predicted position calculated using forward euler (or was it verlet). The velocity allows external forces to influence your constraint e.g gravity applied at each step. After correcting the position in the solver you update the velocities using the new corrected position. You can use different collision detection methods, but you need to find the point of intersection, and then construct a collision constraint using that value, that will be solved like any other constraints. I know this is not the best answer, but I hope it helps.
  10. GameLad

    Position Based Fluids smoke and fire

    Okay thanks, that should explain how positions are corrected.
  11. GameLad

    Position Based Fluids smoke and fire

    I've already implemented one small grid based solver using semi lagrangian advection. The Navier-Stokes equations in that instance are closely followed during discretization. They equation is split and solved according to diffusion, advection of velocities and incompressiblity is enforced by subtracting the gradient of the vector field from the current vector field (or adding, I forget the details). Position based fluids is linked to SPH. I get some of the math behind it, I've implemented a simple distance constraint to get familiar with the PDB framework. PBF only has one constraint (minus the collision constraints created at each step). The pressure constraint enforces incompressiblity. I'm new to lagrangian and PBD dynamics, I'm looking for a simple answer on whats possible in order to save some time. Is smoke and fire possible in PBF? I can't find any references on Google about this. And one more silly question about implementating PBF. Like I said I'm new to particle methods. How do you maintain the distance between particles using the radius? Does finding the delta position, and applying that correction automatically prevent particles from penetrating each other? Or do smoothing kernels take the radius into account?
  12. How do you simulate smoke and fire using position based fluids? I kind of understand how the pressure constraint works.
  13. I have a file exported from a 3d application like Blender or Maya. I am able to read the files. I end up with indices describing each triangle and a vertex list. The file can have more than one connected mesh, two spheres for example. I want to select individual meshes by finding connected triangles (sharing at least one connected vertex). What is the best way to do this? What geometric algorithms can I use? Any examples? Can it be multi threaded?
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!