Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
stevew's avatar
stevew
Honored Guest
10 years ago

OculusRoomTiny(DX11) - how to combine quaternions when observor can look up/down ?

Hey all,

So, I've refactored OculusRoomTiny(DX11)  to make it a little more useful.

The code is here - same license as oculus code - use it if you want for anything.

http://pastebin.com/jLA06b5m

That replaces main.cpp in the oculus OculusRoomTiny(DX11) sample project.

Controls are the same as the original, except cursor up/down now looks up down.

That's the reason for posting - looking up/down introduces a problem. As you can see, when combining the eye & observor orientations transforms now generates incorrect results.

As this is a common use scenario, I'm surprised the sample code doesn't demonstrate this.

Likely a simple quaternion math issue, but as I'm sure others have encountered and solved this, I figured I'd post the refactored code and ask for help before diving deeper.

Refactored code all yours if it's helpful.

Thanks in advance.

Best regards,
Steve.



6 Replies

  • stevew's avatar
    stevew
    Honored Guest
    thanks. tried it the other way too. didn't work either. confused.com

    surely this should be demonstrated in the SDK or is first person up/down considered to be a headset only feature. regardless, would be nice to have the maths working.
  • stevew's avatar
    stevew
    Honored Guest
    @moderator - posted this in wrong group. please delete. have moved to pc development.
  • Yeah, I can move to the dev section. In any case, controlling up/down looking with mouse or keyboard is a thing you should be very careful about doing in VR as it alters the horizon level and can be uncomfortable to viewers.
  • stevew's avatar
    stevew
    Honored Guest
    resolved. must have been too tired yesterday. turns out quaternions work as expected. sorry - this can go :)