Comments (5)
Thank you for the swift reply, I'll just use webpack or another bundler for testing then. Was just curious why it's not working on Glitch.
br,
Max
from ar.js.
@FireDragonGameStudio for info - there is now a new tutorial for location-based three.js, at: https://ar-js-org.github.io/AR.js-Docs/location-based-three/
from ar.js.
Hello Max,
I'm not sure why this is happening, it's related (I would imagine) to how the AR.js bundle is built. It looks like you can't mix the use of an importmap for three.js with the built AR.js location-based bundle. @kalwalt - any ideas?
You can get it to work by installing AR.js via npm and using webpack to build. For example:
{
"dependencies": {
"@ar-js-org/ar.js": "3.4.2"
},
"scripts": {
"build": "npx webpack"
}
}
and the webpack.config.js
as follows:
module.exports = {
mode: 'development',
entry: './script.js',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.js'
},
optimization: {
minimize: false
}
};
and then link to bundle.js
from your HTML.
Also in the JavaScript source, import the modules as follows:
import * as THREE from 'three';
import * as THREEx from '@ar-js-org/ar.js/three.js/build/ar-threex-location-only.js'
I am intending to update the docs soon to reflect this.
Hope that helps.
from ar.js.
I don't think it's Glitch specific, the same problem also occurs when testing on a local machine - but I am not sure myself as I didn't develop the bundling process.
from ar.js.
Closing this now as I believe it has been resolved.
from ar.js.
Related Issues (20)
- Image tracking AR.js with React stuck on loading screen , please help! HOT 2
- Help please! image tracking work but 3d model and video not showing
- change "Twitter" to "𝕏 (Twitter)" in README.md HOT 3
- The camera cannot be controlled by external parameters, especially on phones with multiple cameras,help me please!
- Why the camera fails to be used now?
- Seems like the version is Updated but not the docs and example
- Document is so misleading HOT 2
- Module Import fails in Nuxt3 --- ar-threex-location-only.js --- Cannot read properties of undefined (reading 'THREE') HOT 2
- 将ar.js引入three.js 请求一个功能
- Location based compass orientation is incorrect. It always says North is direction when starting up. HOT 3
- Location Base - Entity is following HOT 3
- Event fired when user "see" an object (location based) HOT 1
- "click" events are not emitted on Android when scene is loaded dynamically HOT 1
- Replacing a building?
- Need help implementing AR.js
- New-location-based entity position problem HOT 1
- Location Based AR.JS project mixed with AFRAME Hit Test
- Place to list device models / OS versions which cause the "content sticking to camera" problem (#278)
- Raycaster intersects invisible marker roots. Is there any landmark to distinguish between displayed and hidden elements? (marker-based)
- node_modules animation-mixer not working HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ar.js.