- Home /
Two Hand Grab World to Move/Scale/Rotate in VR?
So I'm trying to replicate the movement mechanic used by Microsoft Maquette and Tilt Brush, but have no idea where to start/how. To put it simply, when grabbing anywhere in the world with two hands, you can move, rotate, and scale everything around you.
I'm using the SteamVR plugin, but it's pretty easy to translate from any other VR SDK. Has anyone attempted something like this and is willing to share? Any ideas in general?
I apologize for such a silly question, but I cant for the life of me figure out how to get this working. I know tilt brush was open sourced, but looking through the code yielded nothing helpful. Thanks so much for any and all input! :D
Did you ever get any code that implemented your idea. It seems like very useful VR functionality and I've been looking for some code examples for a while.
Answer by artygrand · Mar 03, 2021 at 02:41 PM
Download Oculus Integration for unity and look at Grabber and Grabable, this will be your base. Then in Grabber replace off-hand graabing code with your new interaction code.
Save your hand positions on grab
To stretch you should scale proportionately to hand distance;
Find direction from one hand to another and rotate respectively
Find middle point between hands and move on new offset each frame
Thanks so much for the outline! Unfortunately, I'm kinda still a little confused with the math part. Would you be able to write some pseudocode that I could use? Thanks so much, sorry if that's a lot to ask!