-
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- move marker position initialization from draw to onmessage (markerInfos) - updating thread libs for the examples
- Loading branch information
Showing
6 changed files
with
135 additions
and
114 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,22 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>NFT multi marker example with a WebWorker and Three.js</title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=0.5, maximum-scale=1"> | ||
<script type="importmap"> | ||
{ | ||
"imports": { | ||
"three": "https://cdn.jsdelivr.net/npm/[email protected]/build/three.module.js", | ||
"three/addons/": "https://cdn.jsdelivr.net/npm/[email protected]/examples/jsm/" | ||
} | ||
} | ||
</script> | ||
<link rel="stylesheet" href="css/nft-style.css"> | ||
</head> | ||
<body> | ||
<div id="loading" > | ||
<img src="Data/JsartoolkitNFT-logo.gif"/> | ||
<img alt="JsartoolkitNFT logo" src="Data/JsartoolkitNFT-logo.gif"/> | ||
<span class="loading-text">Loading, please wait</span> | ||
</div> | ||
<!-- | ||
|
@@ -52,38 +60,38 @@ | |
</a> | ||
|
||
<script src="js/third_party/three.js/stats.min.js"></script> | ||
<script src="js/third_party/three.js/three.min.js"></script> | ||
<script src="threejs_multi_worker.js"></script> | ||
|
||
<script> | ||
/** | ||
* STATS | ||
*/ | ||
var statsMain = new Stats(); | ||
statsMain.showPanel( 0 ); // 0: fps, 1: ms, 2: mb, 3+: custom | ||
<script type="module"> | ||
import start from './threejs_multi_worker.js' | ||
|
||
/** | ||
* STATS | ||
*/ | ||
const statsMain = new Stats(); | ||
statsMain.showPanel( 0 ); // 0: fps, 1: ms, 2: mb, 3+: custom | ||
document.getElementById( 'stats1' ).appendChild( statsMain.dom ); | ||
var statsWorker = new Stats(); | ||
statsWorker.showPanel( 0 ); // 0: fps, 1: ms, 2: mb, 3+: custom | ||
const statsWorker = new Stats(); | ||
statsWorker.showPanel( 0 ); // 0: fps, 1: ms, 2: mb, 3+: custom | ||
document.getElementById( 'stats2' ).appendChild( statsWorker.dom ); | ||
/** | ||
* APP / ELEMENTS | ||
*/ | ||
var container = document.getElementById( 'app' ); | ||
var video = document.getElementById( 'video' ); | ||
var canvas = document.getElementById( 'canvas' ); | ||
/** | ||
/** | ||
* APP / ELEMENTS | ||
*/ | ||
const container = document.getElementById('app'); | ||
const video = document.getElementById('video'); | ||
const canvas = document.getElementById('canvas'); | ||
/** | ||
* APP / VIDEO STREAM | ||
*/ | ||
if (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) { | ||
var hint = { | ||
let hint = { | ||
audio: false, | ||
video: true | ||
}; | ||
if( window.innerWidth < 800 ) { | ||
var width = ( window.innerWidth < window.innerHeight ) ? 240 : 360; | ||
var height = ( window.innerWidth < window.innerHeight ) ? 360 : 240; | ||
const width = (window.innerWidth < window.innerHeight) ? 240 : 360; | ||
const height = (window.innerWidth < window.innerHeight) ? 360 : 240; | ||
|
||
var aspectRatio = window.innerWidth / window.innerHeight; | ||
const aspectRatio = window.innerWidth / window.innerHeight; | ||
|
||
console.log( width, height ); | ||
|
||
|
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