3D Game Programming for Kids

3D Game Programming for Kids

So, for some reason, the orthographic camera does not seem to be registering the blocks I’ve created when I switch from perspective: Here

I’ve done a lot of trouble shooting but I cannot discover the root of the problem.
I hope it’s not simple :P
If you could find a solution to this problem in which I don’t have to change much of the code below that start scene stuff, that would be wonderful.
The reason I have this problem is that I was working on a project I thought would be good as 3d but I changed my mind, so now I want it 2d.

Looks like you’ve hit a bug in the version of Three.js that we’re using. You can fix it either by switching to the WebGLRenderer or, if you stick with the CanvasRenderer, by doing something weird (but easy) to the orthographic camera.

The first 4 numbers in the orthographic camera describe the width and height of the camera. Those are fine. The next two number describe how close and how far away things can be so that that camera can see them. The first number, the one that says how close things can be, is the problem.

You should be able to set it to 1 to say that anything at a distance of 1 or more can be seen. That’s what your code does. And again, it works in with the WebGL renderer. But a bug in Three.js breaks that in the canvas renderer.

Happily, there’s a workaround. If you set that number to a negative number, it magically works!
.