mattdesl / canvas-sketch

[beta] A framework for making generative artwork in JavaScript and the browser.
MIT License
5.01k stars 393 forks source link

Threejs default template have to resize chrome window first then render the correct position in 2560*1440 resolution #121

Closed Mayvis closed 3 years ago

Mayvis commented 3 years ago

I have an issue that when I using canvas-sketch default three.js template, the SphereGeometry is not in the center. It position will be at bottom left side. To fix this issue , I need to resize the screen. But this is annoying when I write some code, I always need to resize the chrome browser window again and again. My canvas-sketch version is 1.11.13. Does anyone have the same issue or the way to solve this problem?

截圖 2021-04-30 下午10 41 15

kylestew commented 3 years ago

I was running into the same issue @Mayvis and noticed that the examples don't have this problem. It seems that the ThreeJS template file might be out of date. Try changing this line and see if things are better.

https://github.com/mattdesl/canvas-sketch/blob/24f6bb2bbdfdfd72a698a0b8a0962ad843fb7688/examples/animated-three-basic-cube.js#L26

Mayvis commented 3 years ago

@kylestew Thank you, it works. ; )