aframevr / aframevr/aframe

Regression: camera Y position readback incorrect when in VR

Open
#3,401 19 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
17.6k
Forks
4.4k
PR merge metrics
No merged PRs in 30d

Description

As mentioned in Slack...

mchen [5:53 PM]
I can't recall where exactly, but I think that current master has an issue where the camera position in VR is not getting the correct height value (missing the standing matrix offset?) when you read back its position via getAttribute('position') or .object3D.position?

dmarcos [5:55 PM]
@mchen those issues should be gone

mchen [6:02 PM]
https://codepen.io/machenmusik/pen/oEQbab
1. run Firefox and go to that codepen
2. enter VR and put on your Rift
3. look for the Y label, look down, and notice it's negative

dmarcos [6:03 PM]
It is the rendered height wrong?

mchen [6:03 PM]
the text should be headlocked, as a child of entity with active camera.
both the head sphere and the headlocked text are displayed below where they should be, which is why I had to look down
(the headsphere should be rendered where the HMD is, but since you're inside it, you may only see the nose cone)
the value appears to be off by roughly 1.6 :confused:
https://github.com/aframevr/aframe/pull/3327#issuecomment-360019236
The HMD height assertion in (1) is not correct, as demonstrated by this example.

mchen [6:25 PM]
this version shows controllers, for reference... https://codepen.io/machenmusik/pen/QQJyXV

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the behavior in the linked CodePen on Firefox with an Oculus Rift, then inspect the camera position readback through getAttribute('position') and object3D.position. Done means the reported Y value and the rendered head sphere and headlocked text use the correct HMD height instead of being offset by roughly 1.6.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
ar-vr-xr
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.