openvr icon indicating copy to clipboard operation
openvr copied to clipboard

GetHiddenAreaMesh does not specify mesh format

Open TheHans255 opened this issue 9 years ago • 3 comments

The IVRSystem::GetHiddenAreaMesh method is documented to return a HiddenAreaMesh_t that simply contains a pointer to a list of vertices and an indicated number of triangles. Could you please post more information to the wiki as to what the format of that list of vertices is (i.e. is it 3-vectors or 4-vectors, is it a triangle list or a triangle strip, does it need to be transformed or projected, can it change during program execution, etc.)?

TheHans255 avatar Jun 30 '16 15:06 TheHans255

It's a list of 2d triangles. There should be 20 triangles reported. That's 60 vertices and 2 coordinates per vertex so 120 individual values in the format x1, y1, x2, y2, x3, y3 ... etc

jrbudda avatar Jul 05 '16 16:07 jrbudda

As this issue is the only documentation I found on the subject, let me expand it a bit:

As of today (IVRSystem_017 with a HTC Vive), GetHiddenAreaMesh returns 78 vertices in the [0-1] range. (0,0) is bottom-left.

The rest can be inferred from the definition of HiddenAreaMesh_t. The comments on GetHiddenAreaMesh does not match the definition but match the functionality.

L-P avatar Oct 27 '17 13:10 L-P

There's a C# example of converting the HmdVector2_t pVertexData into a Unity mesh. https://github.com/ValveSoftware/openvr/blob/4c85abcb7f7f1f02adaf3812018c99fc593bc341/samples/unity_teleport_sample/Assets/SteamVR/Scripts/SteamVR_Utils.cs#L390

It's also worth checking out that Ogre3D has mentioned Valve's hidden area mesh in this blogpost: https://www.ogre3d.org/2019/09/22/improvements-in-vr-morph-animations-moving-to-github-and-ci

jorjic avatar Dec 24 '21 23:12 jorjic