Skip to content

Commit

Permalink
Update mesh example (#2938)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pessimistress committed Apr 10, 2019
1 parent 1304946 commit 2fc418d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
11 changes: 5 additions & 6 deletions examples/website/mesh/app.js
Expand Up @@ -5,10 +5,11 @@ import DeckGL, {COORDINATE_SYSTEM, SimpleMeshLayer, OrbitView} from 'deck.gl';
import {OBJLoader} from '@loaders.gl/obj';
import {registerLoaders} from '@loaders.gl/core';

// Add the loaders that handle your mesh format here
registerLoaders([OBJLoader]);

const MESH_URL =
'https://raw.githubusercontent.com/uber-common/deck.gl-data/master/examples/mesh/alfa147.obj';
'https://raw.githubusercontent.com/uber-common/deck.gl-data/master/examples/mesh/minicooper.obj';

const INITIAL_VIEW_STATE = {
target: [0, 0, 0],
Expand All @@ -34,8 +35,8 @@ const SAMPLE_DATA = (([xCount, yCount], spacing) => {
})([10, 10], 120);

class Example extends PureComponent {
_renderLayers() {
return [
render() {
const layers = [
new SimpleMeshLayer({
id: 'mini-coopers',
data: SAMPLE_DATA,
Expand All @@ -46,15 +47,13 @@ class Example extends PureComponent {
getOrientation: d => d.orientation
})
];
}

render() {
return (
<DeckGL
views={new OrbitView()}
initialViewState={INITIAL_VIEW_STATE}
controller={true}
layers={this._renderLayers()}
layers={layers}
/>
);
}
Expand Down
4 changes: 2 additions & 2 deletions examples/website/mesh/package.json
Expand Up @@ -7,8 +7,8 @@
"start-local": "webpack-dev-server --env.local --progress --hot --open"
},
"dependencies": {
"@loaders.gl/core": "^1.0.0-alpha.3",
"@loaders.gl/obj": "^1.0.0-alpha.3",
"@loaders.gl/core": "^1.0.0-alpha.4",
"@loaders.gl/obj": "^1.0.0-alpha.4",
"deck.gl": "^7.0.0-beta",
"react": "^16.3.0",
"react-dom": "^16.3.0"
Expand Down

0 comments on commit 2fc418d

Please sign in to comment.