|
|
|
@ -2501,9 +2501,34 @@ function makeAnchorsVisibleOnTargets(){ |
|
|
|
|
// used for testing |
|
|
|
|
AFRAME.registerComponent('startfunctions', { |
|
|
|
|
init: function () { |
|
|
|
|
startExperience() |
|
|
|
|
doublePinchToScale() |
|
|
|
|
emptyPinchToMove() |
|
|
|
|
makeAnchorsVisibleOnTargets() |
|
|
|
|
addNewNote("hello world", "0 1 -.5") |
|
|
|
|
setTimeout( _ => |
|
|
|
|
applyToClass("notes", (el, val ) => { |
|
|
|
|
console.log(el.object3D.children[0]) |
|
|
|
|
// consider https://threejs.org/docs/?q=.BoundingBoxHelper#api/en/math/Box3 |
|
|
|
|
|
|
|
|
|
const box = new THREE.BoxHelper( el.object3D.children[0], 0xffff00 ); |
|
|
|
|
bbox=el.object3D.children[0].geometry.boundingBox |
|
|
|
|
|
|
|
|
|
p = document.createElement("a-plane") |
|
|
|
|
p.setAttribute("rotation", "90 0 0") |
|
|
|
|
p.setAttribute("width", bbox.max.x-bbox.min.x) |
|
|
|
|
p.setAttribute("height", bbox.max.y-bbox.min.y) |
|
|
|
|
el.appendChild(p) |
|
|
|
|
|
|
|
|
|
return |
|
|
|
|
const geometry = new THREE.PlaneGeometry( el.object3D.children[0].geometry.parameters.width*1.1, |
|
|
|
|
el.object3D.children[0].geometry.parameters.height*1.1 ); |
|
|
|
|
const material = new THREE.MeshBasicMaterial( {color: 0xffffff, side: THREE.DoubleSide} ); |
|
|
|
|
const plane = new THREE.Mesh( geometry, material ); |
|
|
|
|
plane.position.z = -.1 |
|
|
|
|
el.object3D.add( plane ); |
|
|
|
|
}, "") |
|
|
|
|
) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|