diff --git a/index.html b/index.html index e0471cf..e0ed576 100644 --- a/index.html +++ b/index.html @@ -2053,9 +2053,26 @@ function newPrimitiveWithOutline( name="box", position="0 0 0", scale=".1 .1 .1" } function addCompoundPrimitiveExample(position="0 1.4 -0.2"){ + let el = generateCompoundPrimitiveExample(position) + AFRAME.scenes[0].appendChild(el) + targets.push(el) + el.setAttribute('snap-on-pinchended', true) // could set the parameter here, e.g sound if close to same type + return el +} + +function addBlockCodeExample(){ + el = addNewNote("hi") + el.setAttribute("color", "black") + el.setAttribute("outline-color", "white") + a = generateCompoundPrimitiveExample() + el.appendChild(a) + a.setAttribute("position", "0.1 0 -0.051") + el.setAttribute("position", "0 1.4 -0.2"); +} + +function generateCompoundPrimitiveExample(position="0 1.4 -0.2"){ var el = document.createElement("a-entity") el.setAttribute("position", position) - AFRAME.scenes[0].appendChild(el) el.id = "compound_object_" + Date.now() el.className = "compound_object" let parts = [] @@ -2066,8 +2083,6 @@ function addCompoundPrimitiveExample(position="0 1.4 -0.2"){ parts.push( newPrimitiveWithOutline("box", "-.125 0 0.0375", ".05 .05 .025") ) parts.push( newPrimitiveWithOutline("box", "-.125 0 -0.0375", ".05 .05 .025") ) parts.map( p => el.appendChild(p) ) - targets.push(el) - el.setAttribute('snap-on-pinchended', true) // could set the parameter here, e.g sound if close to same type return el } @@ -2162,10 +2177,11 @@ function startExperience(){ - + - + +