As I delve into coding with JS, I decided to experiment with Three.js. Everything was running smoothly until I included the line scene.add(my_square);
. From that point on, my code failed to work and displayed the following error:
Uncaught TypeError: Cannot read property 'center' of undefined
at Sphere.copy (three.js:6754)
at Frustum.intersectsObject (three.js:14106)
at projectObject (three.js:24835)
at projectObject (three.js:24880)
at WebGLRenderer.render (three.js:24654)
at animate (game.js:85)
I attempted adding it solely to my scene but encountered the same issue. Initially named square, I suspected a naming conflict, so I renamed all related variables to my_something.
My testing is being carried out in Chrome. Here's a snippet of my code:
// Code goes here
If this issue seems trivial, I apologize in advance for not identifying it sooner.