Skip to main content
Participant
May 28, 2016

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

Up and Coming
May 28, 2016
Order matters when combining rotations.
Currently working on Dolphin VR Follow along: https://github.com/CarlKenner/dolphin/commits/VR-Hydra Latest Version: viewtopic.php?f=42&t=11241&start=1020#p249426
stevewAuthor
Participant
May 28, 2016
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.
stevewAuthor
Participant
May 28, 2016
@moderator - posted this in wrong group. please delete. have moved to pc development.
Inspiring
May 28, 2016
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.
AMD Ryzen 7 1800X | MSI X370 Titanium | G.Skill 16GB DDR4 3200 | EVGA SuperNOVA 1000 | Corsair Hydro H110i Gigabyte RX Vega 64 x2 | Samsung 960 Evo M.2 500GB | Seagate FireCuda SSHD 2TB | Phanteks ENTHOO EVOLV
stevewAuthor
Participant
May 28, 2016
edit: fixed.
stevewAuthor
Participant
May 29, 2016
resolved. must have been too tired yesterday. turns out quaternions work as expected. sorry - this can go :)