Virtual Variable ThreeJS and GSAP positioning system
I think solution very specific for me and not useful for many 🙂
but still, it should stay here.
document.addEventListener("scroll", function(event) { var x1 = getComputedStyle(document.querySelector('.virtualtag')).getPropertyValue('--camera-x'); var y1 = getComputedStyle(document.querySelector('.virtualtag')).getPropertyValue('--camera-y'); var z1 = getComputedStyle(document.querySelector('.virtualtag')).getPropertyValue('--camera-z'); var x1_only_INT = parseInt(x1, 10); var y1_only_INT = parseInt(y1, 10); var z1_only_INT = parseInt(z1, 10); console.log(x1); console.log(y1); console.log(z1); camera.position.set(x1_only_INT, y1_only_INT, z1_only_INT); });