Skip to content

Commit 58cbd6b

Browse files
committed
screenshot
1 parent 67fcec8 commit 58cbd6b

File tree

4 files changed

+15
-11
lines changed

4 files changed

+15
-11
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
# web-minecraft
22
Render minecrafta w przeglądarce
33
<br><br>
4+
<img src="screenshot_.png"
5+
alt="Screenshot"
6+
style="float: left; margin-right: 10px;" />
7+
<br><br>
8+
<h1>DEMO</h1>
49
Zobacz: <a href="https://michaljaz.github.io/web-minecraft/">DEMO</a>

atlasx.png

-201 KB
Binary file not shown.

index.html

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -326,13 +326,13 @@
326326

327327
camera = new THREE.PerspectiveCamera(75, 2, 0.1, 1000);
328328
camera.rotation.order="YXZ"
329-
camera.position.set(50,50,50)
329+
camera.position.set(26,26,26)
330330
FirstPersonControls(document.getElementById("cross"),camera,0.07)
331331

332332

333333
var ambientLight = new THREE.AmbientLight( 0xcccccc );
334334
scene.add( ambientLight );
335-
var directionalLight = new THREE.DirectionalLight( 0x777777, 2 );
335+
var directionalLight = new THREE.DirectionalLight( 0x666666, 2 );
336336
directionalLight.position.set( 1, 1, 0.5 ).normalize();
337337
scene.add( directionalLight );
338338
scene.fog = new THREE.FogExp2( 0xffffff, 0.00015 );
@@ -347,7 +347,7 @@
347347
textureCols:16,
348348
cellSize:16,
349349
})
350-
var vari=100
350+
var vari=50
351351
// for(var i=0;i<vari;i++){
352352
// for(var j=0;j<vari;j++){
353353
// for(var k=0;k<vari;k++){
@@ -383,10 +383,10 @@
383383
return precision;
384384
}
385385
var geometry = new THREE.BoxGeometry( 1, 1, 1 );
386-
// var material = new THREE.MeshBasicMaterial( {color: 0x00ff00} );
386+
var material = new THREE.MeshBasicMaterial( {color: 0x00ff00} );
387387
var edges = new THREE.EdgesGeometry( geometry );
388388
var cube = new THREE.LineSegments( edges, new THREE.LineBasicMaterial( { color: 0x000000,linewidth:0.5 } ) );
389-
// var cube=new THREE.Mesh()
389+
// var cube=new THREE.Mesh(geometry,material)
390390

391391
var positionQ=[]
392392
// cube.material.visible=false;
@@ -409,8 +409,7 @@
409409
miniDist=ter.distance
410410
mini=ter;
411411
}
412-
}
413-
412+
}
414413
}
415414
if(mini!=null){
416415
selected=true;
@@ -431,8 +430,7 @@
431430
}else if(!world.getVoxel(x2,yd,zd)){
432431
positionQ=[x2,yd,zd]
433432
}
434-
}
435-
if(precision(mini.point.y)==1){
433+
}else if(precision(mini.point.y)==1){
436434
var y1=Math.ceil(mini.point.y);
437435
var y2=Math.floor(mini.point.y);
438436
if(world.getVoxel(xd,y1,zd)){
@@ -445,8 +443,7 @@
445443
}else if(!world.getVoxel(xd,y2,zd)){
446444
positionQ=[xd,y2,zd]
447445
}
448-
}
449-
if(precision(mini.point.z)==1){
446+
}else if(precision(mini.point.z)==1){
450447
var z1=Math.ceil(mini.point.z);
451448
var z2=Math.floor(mini.point.z);
452449
if(world.getVoxel(xd,yd,z1)){
@@ -459,6 +456,8 @@
459456
}else if(!world.getVoxel(xd,yd,z2)){
460457
positionQ=[xd,yd,z2]
461458
}
459+
}else{
460+
462461
}
463462
// console.log(mini.point)
464463
}else{

screenshot_.png

1.96 MB
Loading

0 commit comments

Comments
 (0)