Colisions / boundries question

Hi - quite new to this but having a great time building a VR interaction patch, and my progress has been exciting. However, I have hit almost a brick wall in one regard.

For context, I’m building a simple interactive VR scene to test the limitations of VVVV and how i can apply it to some projects I do at work with students. I so far have built a patch in vr where there is a flip phone model, and a hand. The hand is tied to the VR controller and when you pull the grip, the fingers close. You can grab the flip phone model with the hand. when you do this, the hand animates to appear to grab the phone. So my next steps is that I want to set up bounding boxes or spheres so when the controller or hand reaches where the phone model is, and you grip, the phone will be picked up. So far, when you pull the grip, the phone just snaps to the hands position like magic.

So i have been playing with rays, bounding boxes and bounding spheres. I want to do 2 things:

  1. have a bounds around the hand (or something to that nature) where if the phone comes inside the bounds, I get a boolean response - this will mean i can make the phone grab-able if the hand is near it.
  2. have a bounding sphere tied to a finger on the other hand model so while holding the phone, you can interact with its screen (by setting other bounding spheres on the phones screen surface)

In my testing, I cant see a way to translate a bounding box or sphere based on a goup, etc. so I would have to do complex calculations to work out the bounding spheres position in relation to the hand, yada yada, it gets complicated.

I’m sure I’m just missing the correct way round to do this. I wondered if there was a way to translate/rotate/pivot a sphere as part of a group, then turn the sphere into a bounding sphere so that the bounding sphere is always updated depending on the position of the original sphere.

Hope that makes sense?

If you are using 7.x you could check out VL.Stride.BepuPhysics, especially the help patches for Contact Events, Trigger and Queries. It does not work in latest previews yet though.

Make sure to install the package with:

nuget install VL.Stride.BepuPhysics -prerelease

The -prerelease flag is required because BepuPhysics only exists as a prerelease package on nuget.org.

hmm..since you haven’t asked about physics i’m not sure if bjoerns answer will be of any help.

to me it sounds really like a math question. first i’d make sure you know about the 3D.Collision category. using SphereIntersectsSphere your first thing should be easy, right? if you have the position of the hand, use a Sphere (Join) [3D.Sphere] and place it at that position. then another sphere at the phones position and use SphereIntersectsSphere [3D.Collision] to know if they touch.

then your second thing..i’m afraid i cannot really follow. do you have actual finger tracking in place? or just the controlers?

Using physics you can “just attach” the colliders to the entities and don’t have to do the calculations yourself. With Triggers or ContactEvents you get events you can react to.

Thanks for the responses guys, i will have a look at this asap! Lots of ideas to play with!

I had seen the join sphere - that’s probably the missing link i hadn’t considered! That coukd be fed from a position based on maths and manipulated by an SRTtransformed item

I’ll report my findings and show some patch example for context

Hey guys

Thanks again for your suggestions. I followed down a winding path to get my solve. Turns out I am not as clever as I thought.

I didn’t realise there was a node to decompose an TransformSRT node to give an XYZ position in the 3D world. I am so happy I have the solve, but it was so much simpler than i could understand. I now understand more about bounding spheres…

For anyone in the future that hits this same challenge, use the Decompose node to get XYZ coordinates from a TransformSRT node. Then connect the XYZ to your bounding sphere nodes XYZ position input. That positions your bounding spheres where you might want them to go, if you have a 3D object that is being rotated itself, like a hand that is tied to a floating VR controller. Hopefully my pain here will lead someone in the future to read this post and solve in 5 mins.

I have gotta say, I fucking love vvvv, it has blown my mind tonight in several ways. I cannot wait to spend more time working on the projects I have underway!