Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VectorKeyframeTrack references ".material.opacity" instead of ".position" #52

Open
michaelnicol opened this issue Jun 10, 2022 · 1 comment

Comments

@michaelnicol
Copy link

In the following code in the animation section of the book: Link to code block description

The following code is provided:

These three keyframes will make an object start at the center of the scene, move right, up, and forwards over three seconds, then reverse direction and move back to the center. Next, we’ll create a vector track with these keyframes.

import { VectorKeyframeTrack } from 'three';

const times = [0, 3, 6];
const values = [0, 0, 0, 2, 2, 2, 0, 0, 0 ];

const positionKF = new VectorKeyframeTrack('.material.opacity', times, values);

Since this is a Vector track, the key track property should be .position, not .material.opacity

@looeee
Copy link
Owner

looeee commented Aug 15, 2022

Good catch, I will update this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants