-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from NASA-AMMOS/ts-2
#2 Model Layers
- Loading branch information
Showing
20 changed files
with
871 additions
and
23 deletions.
There are no files selected for viewing
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
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
export default class ModelLayerer { | ||
p: any; | ||
modelCache: any; | ||
constructor(parent: any); | ||
add: (layerObj: any, callback?: Function) => void; | ||
toggle: (name: string, on?: boolean) => boolean; | ||
setOpacity: (name: string, opacity: number) => boolean; | ||
remove: (name: string) => boolean; | ||
private generateModel; | ||
private objToModel; | ||
private daeToModel; | ||
private gltfToModel; | ||
private localizeModel; | ||
} |
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
--- | ||
layout: page | ||
title: Model | ||
permalink: /layers/model | ||
parent: Layers | ||
--- | ||
|
||
# Model | ||
|
||
Adds a model to the scene. | ||
|
||
Supports: .glb, .gltf, .dae, .obj | ||
|
||
Example | ||
|
||
```javascript | ||
Litho.addLayer( | ||
'model', | ||
{ | ||
name: 'roverGLTF', | ||
order: 1, | ||
on: true, | ||
path: 'http://localhost:8888/Missions/MSL/Data/models/Perseverance.glb', | ||
// mtlPath: '', //if path is to an obj | ||
opacity: 0.5, | ||
position: { | ||
longitude: 137.3572927368641, // default 0 | ||
latitude: -4.674971631163808, // default 0 | ||
elevation: -4443.613, // default 0 | ||
}, | ||
scale: 10, // default 1 | ||
rotation: { | ||
// y-up is away from planet center. x is pitch, y is yaw, z is roll | ||
x: Math.PI / 12, // in radians | default 0 | ||
y: Math.PI / 1.5, // default 0 | ||
z: 0, // default 0 | ||
order: 'YXZ', //default YXZ | ||
}, | ||
// cache: true, // default true // If true, uses cloned meshes from the first download | ||
}, | ||
() => { | ||
console.log('Rover loaded') | ||
//Litho.setLayerOpacity('roverGLTF', 0.25) | ||
//Litho.removeLayer('roverGLTF') | ||
/* | ||
Litho.toggleLayer('roverGLTF', false) | ||
setTimeout(() => { | ||
Litho.toggleLayer('roverGLTF', true) | ||
}, 10000) | ||
*/ | ||
} | ||
) | ||
``` |
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
Oops, something went wrong.