tjddizon
tjddizon

Reputation: 15

fade out transition with keyFrameAnimation - ThreeJS

I have 2 different map cubes. After 10 seconds I want the first map cube to fade out and the second map cube to fade in. I was told to use keyFrameAnimation but the only examples I've seen are to make an object move or rotate. If anyone has any examples or a starting point for me..

Any help is greatly appreciated. Thanks!

Upvotes: 0

Views: 1229

Answers (1)

Bob Woodley
Bob Woodley

Reputation: 1284

Change the opacity on the 2 materials in the animation routine.

mesh2.material.opacity = newOpacity;

Be sure that transparent is set to true on the material.

Upvotes: 1

Related Questions