Nabada 2021 in 3D: DEMO Mouse-Events
Nabada 2021 in 3D Demo

Mouse-Events: Enter/Leave/Click


Interaktion durch den Beobachter => Camera mit Cursor
Events: mouseenter, mouseleave, click, touchstart, touchend <
w↑
←ad→
s↓
box.addEventListener('mouseenter', function () { box.setAttribute('rotation', '0 45 0');});
box.addEventListener('mouseleave', function () { box.setAttribute('rotation', '0 0 0'); box.setAttribute('scale', {x:1,y:1,z:1}); });
box.addEventListener('click',      function () { box.setAttribute('scale', {x: 0.5, y: 0.5, z: 0.5});});

cyl.addEventListener('mouseenter', function () { cyl.setAttribute('color', 'lime');});
cyl.addEventListener('mouseleave', function () { cyl.setAttribute('color', 'yellow'); cyl.setAttribute('radius', 0.5); });
cyl.addEventListener('click',      function () { cyl.setAttribute('radius', 0.2);});