diff --git a/index.glb b/index.glb new file mode 120000 index 0000000..dc8f849 --- /dev/null +++ b/index.glb @@ -0,0 +1 @@ +example/assets/index.glb \ No newline at end of file diff --git a/other.glb b/other.glb new file mode 120000 index 0000000..70a12bd --- /dev/null +++ b/other.glb @@ -0,0 +1 @@ +example/assets/other.glb \ No newline at end of file diff --git a/src/3rd/js/three/xrf/pos.js b/src/3rd/js/three/xrf/pos.js index fc7d9e4..a81e0dd 100644 --- a/src/3rd/js/three/xrf/pos.js +++ b/src/3rd/js/three/xrf/pos.js @@ -2,19 +2,15 @@ xrf.frag.pos = function(v, opts){ let { frag, mesh, model, camera, scene, renderer, THREE} = opts let pos = v - + console.dir(pos) // spec: indirect coordinate using objectname: https://xrfragment.org/#navigating%203D if( pos.x == undefined ){ let obj = scene.getObjectByName(v.string) - if( !obj ) return - pos = obj.position.clone() - obj.getWorldPosition(pos) - camera.position.copy(pos) - obj.attach(camera) + if( !obj ) return console.warn("#pos="+v.string+" not found") camera.position.set(0,0,0) + obj.attach(camera) let c = camera.getCam().rotation c.set( c.x, obj.rotation.y, c.z ) - obj.updateMatrixWorld(); // Update parent’s world matrix }else{