Skip to content

Commit

Permalink
move it before scene render
Browse files Browse the repository at this point in the history
  • Loading branch information
Saffo, David committed Feb 2, 2024
1 parent 9dc5e46 commit 5a77942
Show file tree
Hide file tree
Showing 3 changed files with 192 additions and 192 deletions.
26 changes: 13 additions & 13 deletions anu-examples/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,20 @@ const scenes = {
}

let scene = scenes[urlParams.get('example')](babylonEngine);
scene.clearColor = new BABYLON.Color3(30/256,30/256,32/256)
//scene.clearColor = new BABYLON.Color3(30/256,30/256,32/256)

const env = scene.createDefaultEnvironment();
env.setMainColor(BABYLON.Color3.FromHexString('#0e0e17'));

const xr = await scene.createDefaultXRExperienceAsync({
// uiOptions: {
// sessionMode: 'immersive-vr'
// },
floorMeshes: [env.ground]
});
xr.baseExperience.featuresManager.enableFeature(BABYLON.WebXRFeatureName.HAND_TRACKING, "latest", {
xrInput: xr.input
});


//Render the scene we created
Expand All @@ -109,18 +121,6 @@ window.addEventListener("resize", function () {
});


const env = scene.createDefaultEnvironment();
env.setMainColor(BABYLON.Color3.FromHexString('#0e0e17'));

const xr = await scene.createDefaultXRExperienceAsync({
// uiOptions: {
// sessionMode: 'immersive-vr'
// },
floorMeshes: [env.ground]
});
xr.baseExperience.featuresManager.enableFeature(BABYLON.WebXRFeatureName.HAND_TRACKING, "latest", {
xrInput: xr.input
});

// hide/show the Inspector
// window.addEventListener("keydown", (ev) => {
Expand Down

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/public/examples.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<title>AnuJS Visualization Examples</title>


<script type="module" crossorigin src="/anu/assets/index.b901118c.js"></script>
<script type="module" crossorigin src="/anu/assets/index.e37ca8ed.js"></script>
<link rel="stylesheet" href="/anu/assets/index.176030ad.css">
</head>
<body>
Expand Down

0 comments on commit 5a77942

Please sign in to comment.