narthe Posted April 17, 2014 Share Posted April 17, 2014 Hi guys, i'm trying to apply a force on the points of a geometry. So far i have a DOP network where i retrieve my geometry and its points, i give these points a mass and a velocity in my solver i'm coding. Then i add a gravity node. I read this article in the documentation : http://www.sidefx.com/docs/hdk13.0/_h_d_k__op_basics__sim_solver.html#HDK_OpBasics_SimSolver_ExternalForces that explains how to retrieve the forces in the DOP network but then how can i apply them to my points? Tell me if you need more informations. Thanks. Quote Link to comment Share on other sites More sharing options...
narthe Posted April 17, 2014 Author Share Posted April 17, 2014 I'm now wondering what's the difference between getForce() and applyNoise in the SIM_Force class. I'm guessing that i should use applyNoise if i want to apply a force on my points. Quote Link to comment Share on other sites More sharing options...
ikarus Posted April 17, 2014 Share Posted April 17, 2014 When you say apply this force to your points do you mean you want to integrate their velocities/positions according to the force? Quote Link to comment Share on other sites More sharing options...
narthe Posted April 18, 2014 Author Share Posted April 18, 2014 When you say apply this force to your points do you mean you want to integrate their velocities/positions according to the force? Yep that's exactly what i want to do Quote Link to comment Share on other sites More sharing options...
narthe Posted April 18, 2014 Author Share Posted April 18, 2014 I tried using the getForce() function on each of my points. So now i retrieve the force as a vector that is equal to (0.0, -9.80665, 0.0) wich is exactly my gravity so it's great. I guess i have to apply this force on my own on each of my points according to the timestep or the framestep. Quote Link to comment Share on other sites More sharing options...
ikarus Posted April 18, 2014 Share Posted April 18, 2014 A basic euler integration would be vel = vel + force/mass*timeinc pos = pos + vel*timeinc i think the hair solver example in hdk does this if you want an hdk oriented code Quote Link to comment Share on other sites More sharing options...
narthe Posted April 21, 2014 Author Share Posted April 21, 2014 Thanks! i almost did the same but forgot to include the mass of my particules Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.