Jump to content

Recommended Posts

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.

 

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

When you say apply this force to your points do you mean you want to integrate their velocities/positions according to the force?

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Thanks! i almost did the same but forgot to include the mass of my particules ;)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×