In my project, I’d like to place objects at the user’s eye level, but I’m having trouble finding the user’s height. As someone previously asked here, but never got an answer, the camera is somewhere at (0, user height, 0).
Any ideas how to find it? Thanks!
Presuming you are talking about webxr.
In your render loop, see if you can get the current properties of the cameras y
position.
if (renderer.xr.isPresenting) {
console.log(renderer.xr.getCamera(camera).position.y)
}
My camera
variable in my example code above is the same camera used by my renderer.
There are a lot of specifics about your situation that could explain why my suggestion doesn’t work for you. It works for me.
Also experiment with WebXRManager#setReferenceSpaceType – three.js docs
Also, you say “placing objects at user eye level”. This can mean several things to me. For example, see this example ButtonVR Example 1 and look at the crosshair in the middle of the screen. This does not need the users head height to work.
You need to provide more context about your problem if my example code doesn’t point you in the right direction.
Also, there is not enough information in you question to really understand your situation.
What would help is to understand what you have you tried to do yourself?
And why you considered it wrong?