whitecanvas Posted January 3, 2019 Share Posted January 3, 2019 Hello everyone, I am trying to achieve a custom gravity force, an inverse radial sort to say which would allow me to attract DOP objects to the walls of an arbitrary geometry, in this case a tubish shape. Until now I could come up with this: - Assigning to the Dop Gravity Force the Normal value of the primitives of the attractor, with a prim function, but it only takes into account the normal of the single primitive specified. - Creating a radial gravity , negate it and make the tube a collider. The problem here is that since the force is applied in every direction, the object get attracted also where there is no geometry and therefore they don't act as if they where dropped on the ground and keep sliding and rolling.(Idea discarded because it would always push in every direction) - Creating a SDF from the geometry and use the volume gradient to create a force that attracts stuff towards it. Here as well the objects keep rolling and seem to be attracted where there is no geometry regarless of how close to the surface i drop them. In this particular case I don't know what is not working, maybe because I am using the volume for generating the force but the surface for collisions? I think I am missing something inside the vopnet. Could someone point me toward the solution? Thank you for you help and sorry for the long reading Attempts attached Custom_Gravity.hip Quote Link to comment Share on other sites More sharing options...
anim Posted January 3, 2019 Share Posted January 3, 2019 couple of things, I focused only at SDf force as that's the way to go: - you are using Isooffset to generate SDF, which is slow and may introduce artifacts, consider using VDB From Polygons - your volumegradient is not sampling the SDF, but the default cube geo, you have to point it to your geo - your volumegradient is sampling using v, it should sample at P position - you are adding P to result of your gradient, while the gradient direction is already parallel to the tube normal, so you shouldn't mess with it more, just negating and normalizing is fine - VOP Force is old and may be slow, in your case when using RBDs consider using POP Force Instead here is the file with all the changes also has both VOP Force and POP Force approach Custom_Gravity_fix.hip 1 Quote Link to comment Share on other sites More sharing options...
whitecanvas Posted January 4, 2019 Author Share Posted January 4, 2019 Thank you as always, Tomas I knew i was messing up the vop :/ Now this works great, but the cubes keep moving weirdly and never seem to stop. What is this due to? i thought that upping the substeps could solve it but it is actually worse and the cubes go crazy. Regarding this "- VOP Force is old and may be slow, in your case when using RBDs consider using POP Force Instead", would it also work with constrained RBD packed objects? Thank you again Frankie 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.