anakin78z Posted October 14, 2008 Share Posted October 14, 2008 Hey there, So, I feel like this should be simple, but I can't figure out how to use a custom vector field as a force in dops. Basically, I want to build a volume in sops which represents a vector field. I then want to import that volume in dops and use it as a force field. I can't even figure out how to import the volumes... Help? Thanks, -z P.S. using the VOP Force sop would probably work for rbds, but won't work for particle fluids.Local variables Quote Link to comment Share on other sites More sharing options...
Aearon Posted October 14, 2008 Share Posted October 14, 2008 take a look at the fieldforce dop, though i'm not sure it supports volumes you could implement your field as a box of points though and transfer values from the volume Quote Link to comment Share on other sites More sharing options...
aracid Posted October 15, 2008 Share Posted October 15, 2008 Hey anakin78z Dunno if these help, but the one example uses force dop with rbd, the other with fluids forceField.hip hope this helps brian Quote Link to comment Share on other sites More sharing options...
jacob clark Posted October 15, 2008 Share Posted October 15, 2008 Just a reminder, importing SOP vector fields to DOPs destroys multi-threading Hmmm, maybe you can save it out as a .sim file and import it with a File DOP somehow.... Quote Link to comment Share on other sites More sharing options...
anakin78z Posted October 15, 2008 Author Share Posted October 15, 2008 There's multi-threading??? Anyhoo, the fieldforce dop actually works quite nicely. I thought I'd tried it before and found it to be very slow, but I'm finding it plenty fine right now. I was gonna look into using the Sop Scalar Field dop to import the volumes, but for now the field force is doing the trick. Thanks! -z Quote Link to comment Share on other sites More sharing options...
Aearon Posted October 15, 2008 Share Posted October 15, 2008 yeah i also had the feeling the field force dop got faster... maybe they optimized it somewhere along the way. cool! Quote Link to comment Share on other sites More sharing options...
anakin78z Posted October 16, 2008 Author Share Posted October 16, 2008 hmn... I'm not so sure anymore. You really have to keep the number of points way down to keep the speed reasonable. It slows down pretty fast. This is where I was thinking a volume lookup would be much faster. Quote Link to comment Share on other sites More sharing options...
Jason Posted October 16, 2008 Share Posted October 16, 2008 hmn... I'm not so sure anymore. You really have to keep the number of points way down to keep the speed reasonable. It slows down pretty fast. This is where I was thinking a volume lookup would be much faster. Field Force with RBD is terribly slow. It exerts a force on each cell of the Collision SDF, and there is no way to make it affect only the RBD object's center instead. So if you have a high-res collision sdf, or a few of them... OUCH. Same thing goes with the VOP Force DOP. Field Force with fluids is much more acceptable since there is only one volume to resolve. I just looked at the Fluid Force DOP and thought it might also try to do this for you - but it seems to just be a FieldForce under the hood grabbing the "vel" field from an Object. If you want to manufacture your force-field in SOPs, for instance, you can use a SOP Vectorfield DOP into a FieldForce DOP to do it. Quote Link to comment Share on other sites More sharing options...
Aearon Posted October 19, 2008 Share Posted October 19, 2008 that's good to know jason.. explains my different perception because my last test was with fluids. i did remember it as unbearably slow from previous tests... must have been with rbd's then so i had a new idea. why not apply a force using the uniform force dop and an expression that gets v from the sop point that is closest to each rbd's center. you'll find a hda that does this in the attached hip file, also a field force for comparison (it's orders of magnitude slower at the default sdf res) it's not super accurate because there is no interpolation between points, as it just takes the closest one using nearpoint, but it's fast with ten-thousands of points so we can up the resolution of the force geometry if necessary and it should be fine. there will also ways to extend this with interpolation though. rbdforces.hipnc Quote Link to comment Share on other sites More sharing options...
anakin78z Posted October 21, 2008 Author Share Posted October 21, 2008 On first glance that works fantastically well! Thanks for sharing. Quote Link to comment Share on other sites More sharing options...
Aearon Posted October 21, 2008 Share Posted October 21, 2008 very cool, glad to help! Quote Link to comment Share on other sites More sharing options...
Jason Posted October 22, 2008 Share Posted October 22, 2008 Yeah, neat idea. Perhaps it could look up into a Volume (using volumesample()) and that Volume is constructed using point-cloud functions? Might be a little faster, perhaps? But a bigger setup, I suppose. Quote Link to comment Share on other sites More sharing options...
Aearon Posted October 22, 2008 Share Posted October 22, 2008 (edited) yep, that works! great. the setup in dops is the same really, but yeah of course you need the volume first. so here's a new file with a new hda 'SOP Volume Force' the hda expects 3 fields with x,y,z force values respectively i was also thinking that maybe you could attach extra geometry data to the rbd's that is used to fetch the force data using sop nodes. it could just contain one point that is set to the center of the rbd on each simulation step using a sop solver. with this you'd have a lot of flexibility, e.g. you could get force data from a pointcloud using a vop sop. the data would then just be a point attribute and could be applied using uniform force dop and a point expression rbdforces2.hipnc Edited October 22, 2008 by Aearon Quote Link to comment Share on other sites More sharing options...
anakin78z Posted October 22, 2008 Author Share Posted October 22, 2008 i was also thinking that maybe you could attach extra geometry data to the rbd's that is used to fetch the force data using sop nodes. it could just contain one point that is set to the center of the rbd on each simulation step using a sop solver. with this you'd have a lot of flexibility, e.g. you could get force data from a pointcloud using a vop sop. the data would then just be a point attribute and could be applied using uniform force dop and a point expression Hmn... I was trying to get something like this working, but I couldn't figure out how to make a stable setup. I'm still a bit unclear how to best pass data back and forth between sops and dops without causing cooking issues. If you get this setup working, I'd love to see it. Quote Link to comment Share on other sites More sharing options...
Aearon Posted October 22, 2008 Share Posted October 22, 2008 i'll take the challenge, but give me some time 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.