1
0
forked from MTSR/mapserver

camera position

This commit is contained in:
Thomas Rudin 2020-02-14 23:11:53 +01:00
parent bd40508f14
commit 02bed0c79b

View File

@ -1,7 +1,6 @@
var camera, scene, renderer; var camera, scene, renderer;
var geometry = new THREE.BufferGeometry().fromGeometry( var geometry = new THREE.BufferGeometry()
new THREE.BoxGeometry(1,1,1) .fromGeometry(new THREE.BoxGeometry(1,1,1));
);
init(); init();
animate(); animate();
@ -42,7 +41,7 @@ function isNodeHidden(mapblock,x,y,z){
function isTransparent(contentId){ function isTransparent(contentId){
var nodeName = mapblock.blockmapping[contentId]; var nodeName = mapblock.blockmapping[contentId];
return nodeName == "air"; return nodeName == "air" || nodeName == "default:water_source";
} }
if (isTransparent(mapblock.contentid[getNodePos(x-1,y,z)])) if (isTransparent(mapblock.contentid[getNodePos(x-1,y,z)]))
@ -120,8 +119,9 @@ function drawMapblock(posx,posy,posz){
function init() { function init() {
camera = new THREE.PerspectiveCamera( 45, window.innerWidth / window.innerHeight, 2, 2000 ); camera = new THREE.PerspectiveCamera( 45, window.innerWidth / window.innerHeight, 2, 2000 );
camera.position.z = -50; camera.position.z = -150;
camera.position.y = 10; camera.position.x = -150;
camera.position.y = 100;
scene = new THREE.Scene(); scene = new THREE.Scene();