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

Three Js #1654

Closed
andresclua opened this issue Dec 4, 2019 · 1 comment
Closed

Three Js #1654

andresclua opened this issue Dec 4, 2019 · 1 comment

Comments

@andresclua
Copy link

@andresclua andresclua commented Dec 4, 2019

Version

2.4.1

Reproduction link

https://codesandbox.io/s/vue-cli-bdfd3

Steps to reproduce

Hi all,
Basically I am trying to make a minimum version of vue / vuex with three.js.

I have taken the example from https://threejs.org/docs/index.html#manual/en/introduction/Creating-a-scene.

While I can create the scene, add the cube, I have encountered a problem calling the animate function.

What is expected?

Ideally will look more or less something like this.
https://codepen.io/andresclua/pen/WNbbYPb

What is actually happening?

Error in mounted hook: "RangeError: Maximum call stack size exceeded"

@andresclua

This comment has been minimized.

Copy link
Author

@andresclua andresclua commented Dec 4, 2019

Fixed!

animate(){
window.requestAnimationFrame(()=> this.dispatch('animate') );
const state = this.state;
state.cube.rotation.x += 0.01;
state.renderer.render(state.scene, state.camera);
},

@andresclua andresclua closed this Dec 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.