sinanisler logo

Virtual Variable ThreeJS and GSAP positioning system

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);


  camera.position.set(x1_only_INT, y1_only_INT, z1_only_INT);



Leave the first comment