-
-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
95 additions
and
36 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,14 +12,26 @@ | |
🖼 Marker Image | ||
</a> | ||
|
||
<script src="js/third_party/three.js/three.min.js"></script> | ||
<script src="js/ARnftThreejs.js"></script> | ||
<script src="../dist/ARnft.js"></script> | ||
<script type="importmap"> | ||
{ | ||
"imports": { | ||
"three": "https://cdn.jsdelivr.net/npm/[email protected]/build/three.module.js", | ||
"arnft-threejs": "./js/ARnftThreejs.module.js", | ||
"arnft": "./../dist/ARnft.module.js" | ||
} | ||
} | ||
</script> | ||
|
||
<script type="module"> | ||
import * as THREE from 'three' | ||
import arnft from 'arnft' | ||
const { ARnft } = arnft | ||
import ARnftThreejs from 'arnft-threejs' | ||
const { SceneRendererTJS, NFTaddTJS } = ARnftThreejs; | ||
|
||
<script> | ||
let width = 640; | ||
let height = 480; | ||
ARnft.ARnft.initWithConfig({ | ||
ARnft.initWithConfig({ | ||
width: width, | ||
height: height, | ||
markerUrls: [["examples/DataNFT/pinball"]], | ||
|
@@ -60,10 +72,10 @@ | |
}, | ||
}; | ||
|
||
let sceneThreejs = new ARnftThreejs.SceneRendererTJS(config, canvas, nft.uuid, true); | ||
let sceneThreejs = new SceneRendererTJS(config, canvas, nft.uuid, true); | ||
sceneThreejs.initRenderer(); | ||
|
||
let nftAddTJS = new ARnftThreejs.NFTaddTJS(nft.uuid); | ||
let nftAddTJS = new NFTaddTJS(nft.uuid); | ||
nftAddTJS.add(cube, "pinball", false); | ||
|
||
const fpsInterval = 1000 / 30; | ||
|
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 |
---|---|---|
|
@@ -15,16 +15,28 @@ | |
🖼 Marker Image | ||
</a> | ||
|
||
<script src="js/third_party/three.js/three.min.js"></script> | ||
<script src="js/ARnftThreejs.js"></script> | ||
<script src="../dist/ARnft.js"></script> | ||
<script type="importmap"> | ||
{ | ||
"imports": { | ||
"three": "https://cdn.jsdelivr.net/npm/[email protected]/build/three.module.js", | ||
"arnft-threejs": "./js/ARnftThreejs.module.js", | ||
"arnft": "./../dist/ARnft.module.js" | ||
} | ||
} | ||
</script> | ||
|
||
<script type="module"> | ||
import * as THREE from 'three' | ||
import arnft from 'arnft' | ||
const { ARnft } = arnft | ||
import ARnftThreejs from 'arnft-threejs' | ||
const { SceneRendererTJS, NFTaddTJS } = ARnftThreejs; | ||
|
||
<script> | ||
// This example not create the Html elements for loading, stats and container app. | ||
// But instead you define in your html code. See 'config-container.json' for the set-up. | ||
let width = 640; | ||
let height = 480; | ||
ARnft.ARnft.init(width, height, [["examples/DataNFT/pinball"]], [['pinball']], 'config-container.json', true) | ||
ARnft.init(width, height, [["examples/DataNFT/pinball"]], [['pinball']], 'config-container.json', true) | ||
.then((nft) => { | ||
let mat = new THREE.MeshLambertMaterial({ | ||
color: 0xff0000 | ||
|
@@ -58,11 +70,11 @@ | |
} | ||
} | ||
|
||
let sceneThreejs = new ARnftThreejs.SceneRendererTJS(config, canvas, nft.uuid, | ||
let sceneThreejs = new SceneRendererTJS(config, canvas, nft.uuid, | ||
true); | ||
sceneThreejs.initRenderer(); | ||
|
||
let nftAddTJS = new ARnftThreejs.NFTaddTJS(nft.uuid); | ||
let nftAddTJS = new NFTaddTJS(nft.uuid); | ||
nftAddTJS.add(cube, 'pinball', false); | ||
|
||
const tick = () => { | ||
|
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 |
---|---|---|
|
@@ -16,18 +16,30 @@ | |
</a> | ||
<div class="ui" id="dispose" title="click to dispose ARnft and the video stream" onclick="window.closeVideo()">Dispose ARnft</div> | ||
|
||
<script src="js/third_party/three.js/three.min.js"></script> | ||
<script src="js/ARnftThreejs.js"></script> | ||
<script src="../dist/ARnft.js"></script> | ||
<script type="importmap"> | ||
{ | ||
"imports": { | ||
"three": "https://cdn.jsdelivr.net/npm/[email protected]/build/three.module.js", | ||
"arnft-threejs": "./js/ARnftThreejs.module.js", | ||
"arnft": "./../dist/ARnft.module.js" | ||
} | ||
} | ||
</script> | ||
|
||
<script type="module"> | ||
import * as THREE from 'three' | ||
import arnft from 'arnft' | ||
const { ARnft } = arnft | ||
import ARnftThreejs from 'arnft-threejs' | ||
const { SceneRendererTJS, NFTaddTJS } = ARnftThreejs; | ||
|
||
<script> | ||
window.addEventListener('initARnft', function (e) { | ||
console.log("ARnft is starting!"); | ||
}) | ||
let nftOut; | ||
let width = 640; | ||
let height = 480; | ||
ARnft.ARnft.init(width, height, [["examples/DataNFT/pinball"]], [['pinball']], 'config-event.json', true) | ||
ARnft.init(width, height, [["examples/DataNFT/pinball"]], [['pinball']], 'config-event.json', true) | ||
.then((nft) => { | ||
let mat = new THREE.MeshLambertMaterial({ | ||
color: 0xff0000 | ||
|
@@ -61,10 +73,10 @@ | |
} | ||
} | ||
|
||
let sceneThreejs = new ARnftThreejs.SceneRendererTJS(config, canvas, nft.uuid, true); | ||
let sceneThreejs = new SceneRendererTJS(config, canvas, nft.uuid, true); | ||
sceneThreejs.initRenderer(); | ||
|
||
let nftAddTJS = new ARnftThreejs.NFTaddTJS(nft.uuid); | ||
let nftAddTJS = new NFTaddTJS(nft.uuid); | ||
nftAddTJS.add(cube, 'pinball', true); | ||
|
||
const tick = () => { | ||
|
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 |
---|---|---|
|
@@ -19,7 +19,6 @@ | |
{ | ||
"imports": { | ||
"three": "https://cdn.jsdelivr.net/npm/[email protected]/build/three.module.js", | ||
"three/addons/": "https://cdn.jsdelivr.net/npm/[email protected]/examples/jsm/", | ||
"arnft-threejs": "./js/ARnftThreejs.module.js", | ||
"arnft": "./../dist/ARnft.module.js" | ||
} | ||
|
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 |
---|---|---|
|
@@ -15,14 +15,26 @@ | |
🖼 Marker Image | ||
</a> | ||
|
||
<script src="js/third_party/three.js/three.min.js"></script> | ||
<script src="js/ARnftThreejs.js"></script> | ||
<script src="../dist/ARnft.js"></script> | ||
<script type="importmap"> | ||
{ | ||
"imports": { | ||
"three": "https://cdn.jsdelivr.net/npm/[email protected]/build/three.module.js", | ||
"arnft-threejs": "./js/ARnftThreejs.module.js", | ||
"arnft": "./../dist/ARnft.module.js" | ||
} | ||
} | ||
</script> | ||
|
||
<script type="module"> | ||
import * as THREE from 'three' | ||
import arnft from 'arnft' | ||
const { ARnft } = arnft | ||
import ARnftThreejs from 'arnft-threejs' | ||
const { SceneRendererTJS, NFTaddTJS } = ARnftThreejs; | ||
|
||
<script> | ||
let width = 640; | ||
let height = 480; | ||
ARnft.ARnft.init(width, height, [["examples/DataNFT/pinball"]], [['pinball']], 'config_brave_robot.json', true) | ||
ARnft.init(width, height, [["examples/DataNFT/pinball"]], [['pinball']], 'config_brave_robot.json', true) | ||
.then((nft) => { | ||
document.addEventListener('containerEvent', function (ev) { | ||
|
||
|
@@ -48,7 +60,7 @@ | |
} | ||
} | ||
|
||
let sceneThreejs = new ARnftThreejs.SceneRendererTJS(config, canvas, nft.uuid, | ||
let sceneThreejs = new SceneRendererTJS(config, canvas, nft.uuid, | ||
true); | ||
sceneThreejs.initRenderer(); | ||
|
||
|
@@ -60,7 +72,7 @@ | |
directionalLight.position.set(0.5, 0, 0.866); | ||
scene.add(directionalLight) | ||
|
||
let nftAddTJS = new ARnftThreejs.NFTaddTJS(nft.uuid); | ||
let nftAddTJS = new NFTaddTJS(nft.uuid); | ||
// gLTF model provided by Brett Alistair Kromkamp https://github.com/brettkromkamp | ||
nftAddTJS.addModel('./Data/models/brave_robot/gLTF/brave_robot.glb', 'pinball', 80, false); | ||
|
||
|
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 |
---|---|---|
|
@@ -15,14 +15,26 @@ | |
🖼 Marker Image | ||
</a> | ||
|
||
<script src="js/third_party/three.js/three.min.js"></script> | ||
<script src="js/ARnftThreejs.js"></script> | ||
<script src="../dist/ARnft.js"></script> | ||
<script type="importmap"> | ||
{ | ||
"imports": { | ||
"three": "https://cdn.jsdelivr.net/npm/[email protected]/build/three.module.js", | ||
"arnft-threejs": "./js/ARnftThreejs.module.js", | ||
"arnft": "./../dist/ARnft.module.js" | ||
} | ||
} | ||
</script> | ||
|
||
<script type="module"> | ||
import * as THREE from 'three' | ||
import arnft from 'arnft' | ||
const { ARnft } = arnft | ||
import ARnftThreejs from 'arnft-threejs' | ||
const { SceneRendererTJS, NFTaddTJS } = ARnftThreejs; | ||
|
||
<script> | ||
let width = 640; | ||
let height = 480; | ||
ARnft.ARnft.init(width, height, [["examples/DataNFT/pinball"]], [['pinball']], 'config.json', true) | ||
ARnft.init(width, height, [["examples/DataNFT/pinball"]], [['pinball']], 'config.json', true) | ||
.then((nft) => { | ||
document.addEventListener('containerEvent', function (ev) { | ||
|
||
|
@@ -48,7 +60,7 @@ | |
} | ||
} | ||
|
||
let sceneThreejs = new ARnftThreejs.SceneRendererTJS(config, canvas, nft.uuid, | ||
let sceneThreejs = new SceneRendererTJS(config, canvas, nft.uuid, | ||
true); | ||
sceneThreejs.initRenderer(); | ||
|
||
|
@@ -60,7 +72,7 @@ | |
directionalLight.position.set(0.5, 0, 0.866); | ||
scene.add(directionalLight) | ||
|
||
let nftAddTJS = new ARnftThreejs.NFTaddTJS(nft.uuid); | ||
let nftAddTJS = new NFTaddTJS(nft.uuid); | ||
nftAddTJS.addModel('./Data/models/Duck/glTF/Duck.glb', 'pinball', 80, false); | ||
const tick = () => { | ||
sceneThreejs.draw(); | ||
|