Skip to main content
19-Tanzanite
April 2, 2020
Question

Controller button to navigate in Vuforia

  • April 2, 2020
  • 1 reply
  • 3904 views

Hi all,

 

Is it possible to create navigation control (like in mobile games) in Vuforia experience.

 

I went through Quadcopter demo, problem in that is after rotating model all controls works in opposite direction. How we can over come that.

 

/VR

1 reply

18-Opal
April 2, 2020

It depends on how you want it to work. If you want the controls to work relative to the model's orientation, you'll need to add some math transforms to make it work. You should be able to use standard 3D transformation matrices to convert the button presses into translations in the model's coordinate system instead of the universal one.

 

If you want the controls to always function relative to the user, no matter what their orientation or location, you'll also need to add some math transforms to make it work, but you'll want to target the user's coordinate system instead of the model's. @RolandRaytchev has some good posts about how to determine the user/camera location via Javascript, and then you could use translate relative to the user's coordinate system instead of the universal one.

Velkumar19-TanzaniteAuthor
19-Tanzanite
April 6, 2020

Hi @ClayHelberg 

 

Thanks for your response.

 

Is there any post/example available in community or do I need to start from scratch ?

 

/VR 

18-Opal
April 6, 2020

Sorry, I don't remember seeing an example like this, though there may be one in there somewhere.

 

A while back, I worked on an experience where the user could rescale the model, but there were also 3D labels attached to different parts of the model. So when the model scaled, I needed code to recalculate the locations of all the labels so they would still be in the right location relative to the resized model. It wasn't too hard to find the formulas needed to make that work.

 

Here's an easy document that describes various kinds of 3D transformations and the math needed to do them: https://www.cs.brandeis.edu/~cs155/Lecture_07_6.pdf