Skip to content

Commit

Permalink
update copy
Browse files Browse the repository at this point in the history
  • Loading branch information
gkjohnson committed May 9, 2024
1 parent 592c627 commit 1f4626f
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions example/gltfExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls.js';
import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader.js';
import { GLTFMeshFeaturesExtension } from '../src/three/gltf/GLTFMeshFeaturesExtension.js';
import { MeshFeaturesMaterial } from './src/MeshFeaturesMaterial.js';

Check warning on line 12 in example/gltfExample.js

View workflow job for this annotation

GitHub Actions / build (16.x)

'MeshFeaturesMaterial' is defined but never used
import { JPLLandformSiteSceneLoader } from './src/JPLLandformSceneLoader.js';


let camera, controls, scene, renderer;
let dirLight;
Expand All @@ -19,6 +21,10 @@ animate();

function init() {

new JPLLandformSiteSceneLoader().load( '../src/scene.json' ).then( res => {

Check failure on line 24 in example/gltfExample.js

View workflow job for this annotation

GitHub Actions / build (16.x)

Block must be padded by blank lines
console.log( res );

Check failure on line 25 in example/gltfExample.js

View workflow job for this annotation

GitHub Actions / build (16.x)

Block must be padded by blank lines
})

Check failure on line 26 in example/gltfExample.js

View workflow job for this annotation

GitHub Actions / build (16.x)

There must be a space before this paren

Check failure on line 26 in example/gltfExample.js

View workflow job for this annotation

GitHub Actions / build (16.x)

Missing semicolon

scene = new Scene();

// primary camera view
Expand Down Expand Up @@ -51,15 +57,15 @@ function init() {
.loadAsync( 'https://raw.githubusercontent.com/CesiumGS/3d-tiles-samples/main/glTF/EXT_mesh_features/FeatureIdTexture/FeatureIdTexture.gltf' )
.then( res => {

console.log( res.scene.children[ 0 ].userData.meshFeatures.getFeatures( 0, new Vector3( 1, 0, 0 ) ) );
// console.log( res.scene.children[ 0 ].userData.meshFeatures.getFeatures( 0, new Vector3( 1, 0, 0 ) ) );

const group = res.scene.children[ 0 ];
const meshFeatures = group.userData.meshFeatures;
group.material = new MeshFeaturesMaterial();
group.material.setFromFeatureInfo( meshFeatures.getFeatureInfo()[ 0 ], meshFeatures.getTextures() );
// const group = res.scene.children[ 0 ];
// const meshFeatures = group.userData.meshFeatures;
// group.material = new MeshFeaturesMaterial();
// group.material.setFromFeatureInfo( meshFeatures.getFeatureInfo()[ 0 ], meshFeatures.getTextures() );

scene.add( res.scene );
console.log( res.scene );
// scene.add( res.scene );
// console.log( res.scene );

} );

Expand Down

0 comments on commit 1f4626f

Please sign in to comment.