-
-
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.
- flamingo and basic example with new three.module.js - all required libs in the repository
- Loading branch information
Showing
8 changed files
with
108 additions
and
53 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 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 |
---|---|---|
|
@@ -20,20 +20,22 @@ | |
"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-threejs": "./js/ARnftThreejs.module.js", | ||
"arnft": "./../dist/ARnft.module.js" | ||
} | ||
} | ||
</script> | ||
<script src="../dist/ARnft.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; | ||
|
||
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) => { | ||
let mat = new THREE.MeshLambertMaterial({ | ||
color: 0xff0000 | ||
|
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,14 +16,27 @@ | |
🖼 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": "./js/third_party/three.js/three.module.min.js", | ||
"three/addons/": "https://cdn.jsdelivr.net/npm/[email protected]/examples/jsm/", | ||
"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) { | ||
let canvas = document.getElementById("canvas"); | ||
|
@@ -48,7 +61,7 @@ | |
}, | ||
}; | ||
|
||
let sceneThreejs = new ARnftThreejs.SceneRendererTJS(config, canvas, nft.uuid, true); | ||
let sceneThreejs = new SceneRendererTJS(config, canvas, nft.uuid, true); | ||
sceneThreejs.initRenderer(); | ||
|
||
const renderer = sceneThreejs.getRenderer(); | ||
|
@@ -59,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); | ||
let mixers = []; | ||
let clock = new THREE.Clock(); | ||
function modelAnimation(gltf) { | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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