Jump to content
Search Community

Houseofdreams

Members
  • Posts

    4
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Houseofdreams's Achievements

  1. this would be difficult, als the result is a 3D webpage, with a animation. I have no idea on how to minimalise this to fit in a small codepen window.... Maybe I could ask this question on the ThreeJS forum instead?
  2. Hi. I have a 3D object, made in blender,exported as glb and imported in ThreeJS, that has to rotate on it's local axis, instead of the global axis. ( local/global axis, coming from blender) I tried using object.rotation as follows: GSAP.to(this.object.model.children[0].rotation, { duration: 3, y: 3 }); This way, it rotates around the global axis, the wrong way. In ThreeJS, you can also use the object.rotateY function, but I cannot seem to get it to work with GSAP. If I use the following example, it rotates correctly around the Y axis, but "locally" this.object.model.children[0].rotateY(1) Anyone know the correct code to use rotateY with GSAP, or is this not possible? Kind regards
  3. Arrow scope is indeed the solution here onComplete: () => {this.experience.world.level2.show() } Thanks for the assistance !
  4. I'm writing a code, and from one js page I'm using this gsap: GSAP.to(this.shadow.material.uniforms.uAlpha, { duration: 1, delay: duration - .25, value: 1, onComplete: this.experience.world.level2.show }) I'm using show instead of show(), because if I use it with the brackets, ths show function allready fires, before the complete GSAP tween is done. I've read somewhere that I needed to use the functionname without the brackets, which works, the function is actually called at the right time, but with the following problem below: On the receiving javascript page, the function "show" is the following (example, not actual code) show() { console.log(this); } And "this" on the recieving page, should be a javascript Class called " Level2", like the console log example shows below Level2 {experience: Experience, config: {…}, scene: Scene, colors: {…}, setShader: ƒ, …} But when I use the onComplete function in GSAP, the console log gives me this Tween2 {vars: {…}, _delay: 0.75, _repeat: 0, _ts: 1, _dur: 1, …} It just seems like the GSAP code "takes over" the "this" value completely? How is this possible and how can I fix this? Kind regards
×
×
  • Create New...