Skip to content

Commit

Permalink
async testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Saffo, David committed Feb 3, 2024
1 parent 7a54138 commit 5cc6b8f
Show file tree
Hide file tree
Showing 4 changed files with 773 additions and 775 deletions.
16 changes: 14 additions & 2 deletions anu-examples/examples/Geographic/Mesh_Map.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// SPDX-License-Identifier: Apache-2.0
// Copyright : J.P. Morgan Chase & Co.

import { Vector3, Scene, Color4, HemisphericLight, ArcRotateCamera, Vector2 } from '@babylonjs/core';
import { WebXRFeatureName, Color3, Vector3, Scene, Color4, HemisphericLight, ArcRotateCamera, Vector2 } from '@babylonjs/core';
import * as anu from '@jpmorganchase/anu';
import data from 'anu/../../data/airports.csv'
import geoJ from "anu/../../data/gz_2010_us_040_00_5m.json"
import * as d3 from 'd3';


export function meshMap(babylonEngine){
export async function meshMap(babylonEngine){
const scene = new Scene(babylonEngine);
//Add some lighting
new HemisphericLight('light1', new Vector3(0, 10, 0), scene)
Expand Down Expand Up @@ -43,6 +43,18 @@ export function meshMap(babylonEngine){

mapCot.position(new Vector3(0,0.5,-0.5))

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

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

return scene;
}
16 changes: 1 addition & 15 deletions anu-examples/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,23 +93,9 @@ const scenes = {
'meshMap': meshMap,
}

let scene = scenes[urlParams.get('example')](babylonEngine);
let scene = await scenes[urlParams.get('example')](babylonEngine);
//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
babylonEngine.runRenderLoop(() => {
scene.render()
Expand Down
1,514 changes: 757 additions & 757 deletions docs/public/assets/index.085db560.js → docs/public/assets/index.a00bd28c.js

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.085db560.js"></script>
<script type="module" crossorigin src="/anu/assets/index.a00bd28c.js"></script>
<link rel="stylesheet" href="/anu/assets/index.176030ad.css">
</head>
<body>
Expand Down

0 comments on commit 5cc6b8f

Please sign in to comment.