Last active
May 16, 2021 05:49
-
-
Save flushpot1125/6fd6b1f0da55ded42cf58a5e1aa0b690 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xr.baseExperience.onStateChangedObservable.add((state)=>{ | |
if(state === BABYLON.WebXRState.IN_XR){ | |
console.log('WebXR camera position(before_enteringVR): '+xr.baseExperience.camera.position); | |
xr.baseExperience.camera.position.set(0, 2, 10); | |
console.log('WebXR camera position(after_enteringVR): '+xr.baseExperience.camera.position); | |
} | |
}); | |
/*result*/ | |
//WebXR camera position(before_enteringVR): {X: 10 Y:1.2509342432022095 Z:0.0009993872372433543} | |
//WebXR camera position(after_enteringVR): {X: 0 Y:2 Z:10} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment