ValveSoftware / openvr

OpenVR SDK
http://steamvr.com
BSD 3-Clause "New" or "Revised" License
6.08k stars 1.28k forks source link

IVRSystem::GetProjectionRaw - top / bottom values #816

Open FOKSlab opened 6 years ago

FOKSlab commented 6 years ago

Hi, While getting top & bottom values from IVRSystem::GetProjectionRaw top value is negative, bottom positive. While reading the conversion to projection matrix for OpenGL with glFrustum top must be positive and bottom negative, and we must invert the signs of top & bottom (or are top and bottom value inverted in method description ?). Best regards,

bholcomb commented 6 years ago

I think they are backwards in the OpenVR API. In my OpenGL application I swap them and things seem to work fine.

FOKSlab commented 6 years ago

I did this too but if frustum is not symetrical for top/bottom values it can generates invalid frustum (it is OK for HTC Vive, but can be invalid for another HMD). That's why I was wondering if we should use top as bottom value (swapping them) or just modifying the sign for both values.

bholcomb commented 6 years ago

I've tested with Vive, Vive Pro, Oculus, and the HP WMR devices. I know the oculus specifically has an asymmetric frustum and swapping the values gives me the same values that the oculus SDK would give me.

FOKSlab commented 6 years ago

OK ... I swap them so, thanks !