2012-05-13 3 views
0

ThreeJS를 사용하여 평면 지형을 그리려하지만 작동하지 않습니다.ThreeJS의 일반 지형

var plane = new THREE.Mesh(new THREE.PlaneGeometry(300, 300), new THREE.MeshBasicMaterial({ 
     color: 0x0000ff 
    })); 
plane.overdraw = true; 
this.scene.add(plane); 

꽤 솔직 :

여기 내 비행기 생성 코드입니다. 사실 나는 일부 사이트에서 복사했습니다.

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; 

나는 또한 중앙에 반경 (20)의 영역이 있습니다

이 나는 ​​장면과 카메라를 초기화하는 방법입니다. 그것은 잘 나타납니다.

무엇이 누락 되었습니까?

답변

1

카메라가 비행기의 "뒷면"을보고 있습니다.

평면에는 두면이 있지만 한 면만 보입니다.

두 솔루션 :

1) 평면의 "전면"보고 카메라를 이동 :

this.camera.position.y = 100; 

2) 또는이의 doubleSided 플래그를 활성화 :

plane.doubleSided = true; 
+0

감사합니다. 유용한 정보;) – Pijusn