Getting the absolute (standing) position in WebVR - three.js

I am developing a WebVR application using Three.js. In it I am trying to get the standing position relative to the room.
How can I use the VRStageParameters.sittingToStandingTransform matrix in Three.js to transform my camera from sitting to standing space?

Related

Finding compass orientation within a three.js webxr scene

Implementing a three.js webxr web app and trying to get the real-world compass orientation relative to the three.js scene so that I can place objects oriented to north in the AR. e.g. Place an arrow on the floor pointing north.
Webxr sets y rotation to zero relative to the initial launch orientation of the device. i.e. 0 rotation is forwards when you start the app rather than, say, north.
I can get the webxr camera rotation with:
var XRCameraDirectionVector = new THREE.Vector3();
xrCamera.getWorldDirection(XRCameraDirectionVector);
let XRCameraDirectionDegrees = THREE.MathUtils.radToDeg(XRCameraDirectionVector.x);
I can get the compass per this article.
I know that I could take the compass bearing at the time that the zero is first set and use that as an offset, but I want to keep taking readings from the compass to improve the accuracy as the user moves around, so that would be fiddly.
I'm sure I'm missing something obvious, but how do I find where north is within the scene, please? Thanks.

Three.js always rotate about world center

I'm currently following a tutorial on how to get a 3d model view in three.js
But I notice that whenever I pan the camera (right-click and drag), the center of rotation changes.
Is it possible to make the axis of rotation stay in the world center/object center?
Many thanks!

Keep ThreeJs sprite looking at Mapbox camera

How can I keep my sprites facing the Mapbox gl camera?
To do this, I assume I need access to the Mapbox camera position - however, I don't know how to access this from inside the Three.js scene.
Any ideas?

Using ARCore for Measurment

I would like to know if it is possible to measure the dimensions of an object by just pointing the camera at the object without moving the camera from left to right like we do in Google Measurement.
A depth map cannot be calculated from just a 2D camera image. A smart phone does not have a distance sensor but it does have motion sensors, so by combining the movement of the device with changes in the input from the camera(s), ARCore can calculate depth. To put it simply, objects in close to the camera move around on screen more, compared to objects further away.
To get depth data from a fixed position would require different technologies than found on current phones, such as LiDAR or an infrared beam projector and infrared camera.

Position of camera on running Locomotive

I used three's SplineCurve3 to drive the locomotive dynamically, but I wanted to put a camera in the cab. At the same time, the position of the camera changes with the locomotive to achieve the actual effect of the locomotive. How to control the position of the camera on the curved path?

Resources