x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Motion Controller Pitch Range

I'm currently trying to use a Vive Motion Controller to emulate flightstick style controls. I'm trying to get them to work as follows:

With the controllers held straight upwards, the pitch should be 0 and when tilted forwards or backwards the pitch should be between 1 and -1.

My problem is that the values returned from GetWorldRotation or GetHandPositionAndOrientation go from 0 (controller tilted forward 90 degrees) to 90 (controller facing upwards) back to 0 (controller tilted backwards 90 degrees).

How would I go about getting a full 180 degree range of values from the controller?

Product Version: UE 4.12
Tags:
more ▼

asked Sep 19 '16 at 01:06 PM in VR

avatar image

thesonglessbird
20 2 4 6

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

What I would do is define a direction as up. Either by using an invisible arrow component or something, or simply defining a vector in code. Then I use the dot product between the stick forward vector and the base position vector. By doing so you can get a full range of values from 180 to -180.

HTH

more ▼

answered Sep 19 '16 at 01:26 PM

avatar image

NoobsDeSroobs
2.7k 107 35 180

avatar image thesonglessbird Sep 19 '16 at 04:01 PM

Thanks for the help! Doing what you suggested didn't give me what I wanted exactly but it put me on the right track. I'm using the controller forward vector and getting a value between 1 and -1 which seems to do the trick.

avatar image jasonh2013 Jun 25 '17 at 02:51 PM

hi songlessbird, what did you do exactly? Using controller forward vector I get a value between 1 and -1, but it still restarts when I point the motioncontroller to the sky once I get to 1. I still don't have a full 180 degree range of values above the horizontal plane.

avatar image wickedknock Apr 11 '17 at 08:35 AM

how did you get it to work ?

avatar image jasonh2013 Jun 25 '17 at 02:50 PM

NooobsdeSroobs, what does dot product mean? You mean multiply? You are multiplying the "stick forward vector" and the base position vector? What do you mean by stick forward vector? Are you referring to the invisible arrow? What do you mean by the base position vector? The base position of the motion controller? How do you get the base position of the motion controller? Thank you for your time.

avatar image S-ed Jun 25 '17 at 06:56 PM
avatar image jasonh2013 Jun 25 '17 at 07:25 PM

Thank you.

avatar image jasonh2013 Jun 25 '17 at 08:49 PM

Also, this brief video tutorial on dot product helped me understand things a little better: https://www.youtube.com/watch?v=sf3jT12pN6o

It combined a presentation of the concept with a short guide on how to practically implement it within UE4 blueprints.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question