-
Notifications
You must be signed in to change notification settings - Fork 288
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FIX] Handle glTF triangles without indices; add some examples #1385
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<title>xeokit Example</title> | ||
<link href="../css/pageStyle.css" rel="stylesheet"/> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.0/js/all.min.js"></script> | ||
</head> | ||
<body> | ||
<input type="checkbox" id="info-button"/> | ||
<label for="info-button" class="info-button"><i class="far fa-3x fa-question-circle"></i></label> | ||
<canvas id="myCanvas"></canvas> | ||
<div class="slideout-sidebar"> | ||
<img class="info-icon" src="../../assets/images/gltf_logo.png"/> | ||
<h1>GLTFLoaderPlugin</h1> | ||
<h2>Viewing a glTF model exported from google Street Mapsl</h2> | ||
<p>In this example, we're using a <a | ||
href="../../docs/class/src/plugins/GLTFLoaderPlugin/GLTFLoaderPlugin.js~GLTFLoaderPlugin.html" | ||
target="_other">GLTFLoaderPlugin</a> to load the <a | ||
href="https://sketchfab.com/bimcc" | ||
target="_other">House Plan</a> demo model from | ||
binary glTF (.glb).</p> | ||
<h3>Components used</h3> | ||
<ul> | ||
<li> | ||
<a href="../../docs/class/src/viewer/Viewer.js~Viewer.html" | ||
target="_other">Viewer</a> | ||
</li> | ||
<li> | ||
<a href="../../docs/class/src/plugins/GLTFLoaderPlugin/GLTFLoaderPlugin.js~GLTFLoaderPlugin.html" | ||
target="_other">GLTFLoaderPlugin</a> | ||
</li> | ||
</ul> | ||
<h3>Assets</h3> | ||
<ul> | ||
<li> | ||
<a href="https://www.google.com/maps" | ||
target="_other">Model source</a> | ||
</li> | ||
</ul> | ||
</div> | ||
</body> | ||
<script type="module"> | ||
|
||
import {Viewer, GLTFLoaderPlugin} from "../../dist/xeokit-sdk.es.js"; | ||
|
||
const viewer = new Viewer({ | ||
canvasId: "myCanvas", | ||
transparent: true, | ||
dtxEnabled: true, | ||
colorTextureEnabled: true | ||
}); | ||
|
||
viewer.camera.eye = [1394.38, 3.78, -247.05]; | ||
viewer.camera.look = [1391.46, 0.89, -244.24]; | ||
viewer.camera.up = [-0.41, 0.81, 0.40]; | ||
|
||
const gltfLoader = new GLTFLoaderPlugin(viewer); | ||
|
||
const sceneModel = gltfLoader.load({ | ||
id: "Beograd_01", | ||
src: "../../assets/models/gltf/GoogleStreetMaps/Beograd_01.gltf" | ||
}); | ||
|
||
sceneModel.on("loaded", () => { | ||
viewer.cameraFlight.jumpTo(sceneModel); | ||
}); | ||
|
||
window.viewer = viewer; | ||
</script> | ||
</html> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<title>xeokit Example</title> | ||
<link href="../css/pageStyle.css" rel="stylesheet"/> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.0/js/all.min.js"></script> | ||
Check warning Code scanning / CodeQL Inclusion of functionality from an untrusted source Medium
Script loaded from content delivery network with no integrity check.
|
||
</head> | ||
<body> | ||
<input type="checkbox" id="info-button"/> | ||
<label for="info-button" class="info-button"><i class="far fa-3x fa-question-circle"></i></label> | ||
<canvas id="myCanvas"></canvas> | ||
<div class="slideout-sidebar"> | ||
<img class="info-icon" src="../../assets/images/gltf_logo.png"/> | ||
<h1>GLTFLoaderPlugin</h1> | ||
<h2>Viewing a glTF model exported from google Street Maps</h2> | ||
<p>In this example, we're using a <a | ||
href="../../docs/class/src/plugins/GLTFLoaderPlugin/GLTFLoaderPlugin.js~GLTFLoaderPlugin.html" | ||
target="_other">GLTFLoaderPlugin</a> to load the <a | ||
href="https://sketchfab.com/bimcc" | ||
target="_other">House Plan</a> demo model from | ||
binary glTF (.glb).</p> | ||
<h3>Components used</h3> | ||
<ul> | ||
<li> | ||
<a href="../../docs/class/src/viewer/Viewer.js~Viewer.html" | ||
target="_other">Viewer</a> | ||
</li> | ||
<li> | ||
<a href="../../docs/class/src/plugins/GLTFLoaderPlugin/GLTFLoaderPlugin.js~GLTFLoaderPlugin.html" | ||
target="_other">GLTFLoaderPlugin</a> | ||
</li> | ||
</ul> | ||
<h3>Assets</h3> | ||
<ul> | ||
<li> | ||
<a href="https://www.google.com/maps" | ||
target="_other">Model source</a> | ||
</li> | ||
</ul> | ||
</div> | ||
</body> | ||
<script type="module"> | ||
|
||
import {Viewer, GLTFLoaderPlugin} from "../../dist/xeokit-sdk.es.js"; | ||
|
||
const viewer = new Viewer({ | ||
canvasId: "myCanvas", | ||
transparent: true, | ||
colorTextureEnabled: true | ||
}); | ||
|
||
viewer.camera.eye = [1394.38, 3.78, -247.05]; | ||
viewer.camera.look = [1391.46, 0.89, -244.24]; | ||
viewer.camera.up = [-0.41, 0.81, 0.40]; | ||
|
||
// This is a large model, so a distant far clipping plane is recommended | ||
|
||
viewer.camera.project.far = 10000; | ||
|
||
const gltfLoader = new GLTFLoaderPlugin(viewer); | ||
|
||
const sceneModel = gltfLoader.load({ | ||
id: "Beograd_Centar_Google_maps", | ||
src: "../../assets/models/gltf/GoogleStreetMaps/Beograd_Centar_Google_maps.glb" | ||
}); | ||
|
||
sceneModel.on("loaded", () => { | ||
viewer.cameraFlight.jumpTo(sceneModel); | ||
}); | ||
|
||
window.viewer = viewer; | ||
</script> | ||
</html> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<title>xeokit Example</title> | ||
<link href="../css/pageStyle.css" rel="stylesheet"/> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.0/js/all.min.js"></script> | ||
Check warning Code scanning / CodeQL Inclusion of functionality from an untrusted source Medium
Script loaded from content delivery network with no integrity check.
|
||
</head> | ||
<body> | ||
<input type="checkbox" id="info-button"/> | ||
<label for="info-button" class="info-button"><i class="far fa-3x fa-question-circle"></i></label> | ||
<canvas id="myCanvas"></canvas> | ||
<div class="slideout-sidebar"> | ||
<img class="info-icon" src="../../assets/images/gltf_logo.png"/> | ||
<h1>GLTFLoaderPlugin</h1> | ||
<h2>Viewing a glTF model exported from google Street Maps</h2> | ||
<p>In this example, we're using a <a | ||
href="../../docs/class/src/plugins/GLTFLoaderPlugin/GLTFLoaderPlugin.js~GLTFLoaderPlugin.html" | ||
target="_other">GLTFLoaderPlugin</a> to load the <a | ||
href="https://sketchfab.com/bimcc" | ||
target="_other">House Plan</a> demo model from | ||
binary glTF (.glb).</p> | ||
<h3>Components used</h3> | ||
<ul> | ||
<li> | ||
<a href="../../docs/class/src/viewer/Viewer.js~Viewer.html" | ||
target="_other">Viewer</a> | ||
</li> | ||
<li> | ||
<a href="../../docs/class/src/plugins/GLTFLoaderPlugin/GLTFLoaderPlugin.js~GLTFLoaderPlugin.html" | ||
target="_other">GLTFLoaderPlugin</a> | ||
</li> | ||
</ul> | ||
<h3>Assets</h3> | ||
<ul> | ||
<li> | ||
<a href="https://www.google.com/maps" | ||
target="_other">Model source</a> | ||
</li> | ||
</ul> | ||
</div> | ||
</body> | ||
<script type="module"> | ||
|
||
import {Viewer, GLTFLoaderPlugin} from "../../dist/xeokit-sdk.es.js"; | ||
|
||
const viewer = new Viewer({ | ||
canvasId: "myCanvas", | ||
transparent: true, | ||
dtxEnabled: true, | ||
colorTextureEnabled: true | ||
}); | ||
|
||
viewer.camera.eye = [1394.38, 3.78, -247.05]; | ||
viewer.camera.look = [1391.46, 0.89, -244.24]; | ||
viewer.camera.up = [-0.41, 0.81, 0.40]; | ||
|
||
const gltfLoader = new GLTFLoaderPlugin(viewer); | ||
|
||
const sceneModel = gltfLoader.load({ | ||
id: "Dve_kule_GLTF_Small_1", | ||
src: "../../assets/models/gltf/GoogleStreetMaps/Dve_kule_GLTF_Small_1.gltf" | ||
}); | ||
|
||
sceneModel.on("loaded", () => { | ||
viewer.cameraFlight.jumpTo(sceneModel); | ||
}); | ||
|
||
window.viewer = viewer; | ||
</script> | ||
</html> |
Check warning
Code scanning / CodeQL
Inclusion of functionality from an untrusted source Medium