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"

Incorrect eye offset with HMD after Rotation

I'm currently testing some things with the Oculus DK2 and UE4 4.7.5.

I'm trying to implement a simple view from a cockpit of a spacecraft. While the user camera is fixed to the cockpit, the cockpit itself need to be able to turn over three axis. The issue I'm encountering seems simple but I can't figure out how to solve it.

My issue is : when rotating the cockpit I can end up upside down. Meaning my head is down and my legs are up. In this situation I get an offset different for each eye and my vision is not synced anymore. From what I understand the HMD stays in World Space and therefore compute a wrong eye position (basically they are inverted).

This is easily visible with this image :

alt text

You can see that when I'm head down (the gray ground is on top of the image) the cockpit is offset away from the center of the screen on the left eye (while the inverse happens on the right eye).

My current code is very simple and I'm not sure what do to fix that. My camera is a camera component attached to my Character class. I retrieve the HMD rotation to rotate it in relative space. This allow me to get relative rotation what orientation the cockpit has.

         //----------------------------------------------------------------
         //Update rotation
         //----------------------------------------------------------------
         //Retrieve HMD rotation/position
         FQuat HmdCurrentOrientation;
         FVector HmdCurrentPosition;
         GEngine->HMDDevice->GetCurrentOrientationAndPosition(HmdCurrentOrientation, HmdCurrentPosition);
         
         Camera->SetRelativeRotation( FRotator( HmdCurrentOrientation ) );

A solution I saw was to set the World to Meters scale in the World properties of my scene to 1 instead of 100. Unfortunately while it fix the rotation issue (because the offset between the eyes almost doesn't change I believe), it makes my cockpit (and world) way too big. :)

Is there a way to handle the HMD in local space instead of world space ?

Product Version: Not Selected
Tags:
eye_offset.gif (150.8 kB)
more ▼

asked Apr 18 '15 at 05:31 PM in VR

avatar image

Froyok
260 22 27 37

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

1 answer: sort voted first

Okay I figured out why this was happening : basically I was rotating the camera via a custom UpdateRotation() override of the function present in the PlayerController class. By doing so I missed the part where I add to normalize the result of the rotation before feeding it to the HMD.

The exact process can be found in APlayerCameraManager::ProcessViewRotation() (which is called by UpdateRotation() ).

more ▼

answered Apr 21 '15 at 05:57 PM

avatar image

Froyok
260 22 27 37

(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