a-tube test and cleanup

pull-to-value
Fabien Benetou 6 months ago
parent 08084875c9
commit 42ef7ff120
  1. 6
      index.html
  2. 38
      jxr.js

@ -14,6 +14,8 @@
<!--<script type="module" id=immersbundle src="https://cdn.jsdelivr.net/npm/immers-client/dist/destination.bundle.js?role=modFull"></script>-->
<!--<script src="https://threejs.org/examples/js/exporters/GLTFExporter.js"></script>-->
<script src="https://cdn.jsdelivr.net/gh/c-frame/aframe-extras@7.1.0/dist/aframe-extras.min.js"></script>
<script src="dependencies/shiki0.14.1.js"></script>
<!-- for input sharing -->
@ -298,6 +300,10 @@ AFRAME.registerComponent('wristright',{
<a-box scale="0.1 0.01 30" position="0 0.01 0" color="blue"></a-box>
<a-box scale="0.1 0.01 30" position=" 9 0.01 0" color="blue"></a-box>
<a-box hide-on-enter-ar="" scale="60 0.01 30" color="lightblue"></a-box>
<a-entity gltf-model="url(../content/PlayerSkater_Animations2.glb)" position="0 0 -2" animation-mixer="clip: *Hawk"></a-entity>
<a-tube path="0 1 0,-5 1 -7,-20 1 -12,-25 1 0,-25 1 10,0 1 10,25 1 12,25 1 -12,-5 1 -12" radius="1" material="color: red;wireframe:true"></a-tube>
</a-scene>
</body>
</script>

@ -3623,36 +3623,36 @@ consider also
see https://git.benetou.fr/utopiah/text-code-xr-engine/issues/52 for more shorthands
*/
const movePenguin = "jxr qs #penguin sa position 1 0 -2"
const rotatePenguin = "jxr qs #penguin sa rotation 0 -20 0"
//const movePenguin = "jxr qs #penguin sa position 1 0 -2"
//const rotatePenguin = "jxr qs #penguin sa rotation 0 -20 0"
//addBlockCodeExample(text="hi", pos="0 1.4 -0.2", color="black", outlineColor="white")
addBlockCodeExample('add penguin', '0 1.5 -0.2')
let elToAnnotate = addBlockCodeExample('move penguin forward', '0 1.6 -0.2')
addAnnotation(elToAnnotate, 'fait avancer pengouin')
console.log(elToAnnotate)
addBlockCodeExample('add green cube', '0 1.4 -0.2')
addBlockCodeExample(movePenguin, '0 1.45 -0.2')
addBlockCodeExample(rotatePenguin, '0 1.55 -0.2')
//addBlockCodeExample('add penguin', '0 1.5 -0.2')
//let elToAnnotate = addBlockCodeExample('move penguin forward', '0 1.6 -0.2')
//addAnnotation(elToAnnotate, 'fait avancer pengouin')
//console.log(elToAnnotate)
//addBlockCodeExample('add green cube', '0 1.4 -0.2')
//addBlockCodeExample(movePenguin, '0 1.45 -0.2')
//addBlockCodeExample(rotatePenguin, '0 1.55 -0.2')
// should change color and enable the 2 new types
//relies on addCompoundPrimitiveExample() which already uses snap-on-pinched-ended
// also relies on addNewNote() so means code might be executed on left pinch or move with right pinch indepdently from block, to verify
let el = generateCompoundPrimitiveStart(position="-0.2 1.5 -0.2")
targets.push(el)
//let el = generateCompoundPrimitiveStart(position="-0.2 1.5 -0.2")
//targets.push(el)
//el.setAttribute('snap-on-pinchended', true)
el.setAttribute('scale', '.1 .1 .1')
AFRAME.scenes[0].appendChild(el)
//el.setAttribute('scale', '.1 .1 .1')
//AFRAME.scenes[0].appendChild(el)
el = generateCompoundPrimitiveEnd(position="0.2 1.5 -0.2")
targets.push(el)
//el = generateCompoundPrimitiveEnd(position="0.2 1.5 -0.2")
//targets.push(el)
//el.setAttribute('snap-on-pinchended', true)
el.setAttribute('scale', '.1 .1 .1')
AFRAME.scenes[0].appendChild(el)
//el.setAttribute('scale', '.1 .1 .1')
//AFRAME.scenes[0].appendChild(el)
// consider instanciateFromPrimitive() also in order to clone a set of blocks
AFRAME.scenes[0].setAttribute('trail', '')
//AFRAME.scenes[0].setAttribute('trail', '')
}
})

Loading…
Cancel
Save