Hey, i am trying to figure out how to add a glb file on top of my tracked marker in ar.js but it does not seem to be working. Does anybody know the solution to this?
function loadAvatar(scene) {
const loader = new THREE.GLTFLoader();
loader.load(‘/models/66e9e39abe6bd8d1c0a605b2.glb’, (gltf) => {
const avatar = gltf.scene;
avatar.scale.set(2, 2, 2); // Adjust the scale to make the avatar bigger
avatar.position.set(0, 0, 0); // Position it to be on top of the marker
console.log(“Avatar loaded:”, avatar);
// Add avatar to the main scene
scene.add(avatar);
}, undefined, (error) => {
console.error('Error loading avatar:', error);
});
}