I've been attempting to create a flat terrain using ThreeJS, but it doesn't seem to be working as expected.
Here is the code I'm using to create the plane:
var plane = new THREE.Mesh(new THREE.PlaneGeometry(300, 300), new THREE.MeshBasicMaterial({
color: 0x0000ff
}));
plane.overdraw = true;
this.scene.add(plane);
It seems pretty straightforward. To be honest, I just copied it from somewhere on the internet.
This is how I set up my scene and camera:
this.camera =
new THREE.PerspectiveCamera(
45, // view angle
width / height, // aspect
0.1, // near
10000); // far
this.scene = new THREE.Scene();
// add the camera to the scene
this.scene.add(this.camera);
// the camera starts at 0,0,0
// so pull it back
this.camera.position.z = 800;
this.camera.position.y = -100;
In addition to the plane, I also have a sphere with a radius of 20 at the center, which displays correctly.
But what am I overlooking?