0

Not sure why this isn't working for me as it should be quite trivial. I am trying to run an example from three.js http://threejs.org/examples/#webgl_interactive_buffergeometry

I have copied the Three.min.js, Detector.js, and stats.min.js. When I run it I get an error about THREE.PerspectiveCamera.

Indeed I do see that the PerspectiveCamera is not defined in the three.min.js. Also, after digging around, I do see that there is a Cameras/PerspectiveCamera.js, though not part of the standard three.js library.

  • So how to make this example work?
  • How can the example snippet work without referencing the PerspectiveCamera.js?

1 Answer 1

1

Maybe you're using an older build of three.js. That example is using the last build (r75), and THREE.PerspectiveCamera is defined.

You can find last build here

Sign up to request clarification or add additional context in comments.

3 Comments

So does this mean the newest/latest/preferred way is to reference each individual .JS files? I'm finding I need to reference an awful lot of files (PerspectiveCamera, object3d, vector3....etc).
I didn't really understand what you mean. If you mean that Detector.js and stats.min.js need the latest build to work, it could be, not always. But PerspectiveCamera, object3d and vector3 are defined in three.min.js, so they don't need to be referenced
Let me explain: If I do NOT use the r75 build of three.js, then I must reference PerspectiveCamera.js, right? So it seems the latest build separated out these various components - so I need to reference each script/file in order to use it. Correct?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.