귀하의 코드 당신은 또한 카메라와 광원이 가정, 기본적으로 바로 보인다. 여기에 a playground entry입니다.
var scene = new BABYLON.Scene(engine);
//Create a light
var light = new BABYLON.PointLight("Omni", new BABYLON.Vector3(-60, 60, 80), scene);
//Create an Arc Rotate Camera - aimed negative z this time
var camera = new BABYLON.ArcRotateCamera("Camera", Math.PI/2, 1.0, 210, BABYLON.Vector3.Zero(), scene);
camera.attachControl(canvas, true);
//Creation of a repeated textured material
var materialPlane = new BABYLON.StandardMaterial("texturePlane", scene);
materialPlane.diffuseTexture = new BABYLON.Texture("textures/grass.jpg", scene);
materialPlane.specularColor = new BABYLON.Color3(0, 0, 0);
materialPlane.backFaceCulling = false;//Allways show the front and the back of an element
//Creation of a plane
var plane = BABYLON.Mesh.CreatePlane("plane", 120, scene);
plane.rotation.x = Math.PI/2;
plane.material = materialPlane;
난 후, 자신의 데모 중 하나를 시작 최소한의 예를 얻을 수있는 물건의 대부분을 멀리 해킹 :
는 그리고 후세를 위해, 여기에 코드입니다. 나는 backFaceCulling = false
에 남았습니다 (그렇지 않으면 이미지는 한 방향에서만 볼 수 있습니다). specularColor
설정에 추가되었습니다.
다른 방법은 diffuseTexture
emissiveTexture
로 대체하는 것입니다 :
materialPlane.emissiveTexture = new BABYLON.Texture("textures/grass.jpg", scene);
그런 다음 당신이 빛을 주석 처리 할 수 있으며, 그것은 여전히 볼 수 있습니다. 실제로 조명을 비춰두면 과다 노출이 발생합니다.
(키보드 컨트롤 및 충돌 감지 질문에 대한 새로운 질문을 시작하거나 바빌론 샘플 및 자습서 비디오를 통해 작업 할 것을 권장합니다.)