fix
This commit is contained in:
parent
b758a96da2
commit
52d464d706
BIN
dist/img/2.hdr
vendored
Normal file
BIN
dist/img/2.hdr
vendored
Normal file
Binary file not shown.
27
src/index.ts
27
src/index.ts
@ -16,10 +16,8 @@ window.addEventListener("DOMContentLoaded", () => {
|
||||
if (canvas == null) return;
|
||||
|
||||
const scene = new THREE.Scene();
|
||||
|
||||
const camera = new THREE.PerspectiveCamera(
|
||||
30, canvas.clientWidth/canvas.clientHeight, 0.1, 20);
|
||||
camera.position.set(0.0, 0.9, -4.0)
|
||||
const camera = new THREE.PerspectiveCamera( 70, canvas.clientWidth/canvas.clientHeight, 0.1, 2000);
|
||||
camera.position.set(0, 1, -1.5)
|
||||
camera.rotation.set(0.0, Math.PI, 0.0)
|
||||
camera.lookAt(new THREE.Vector3(0, 0, 0));
|
||||
|
||||
@ -115,7 +113,7 @@ window.addEventListener("DOMContentLoaded", () => {
|
||||
const ambientLight = new THREE.AmbientLight(0x333333);
|
||||
scene.add(ambientLight);
|
||||
|
||||
const floor = new Mesh(
|
||||
let floor = new Mesh(
|
||||
new BoxGeometry(50, 100),
|
||||
new MeshLambertMaterial({
|
||||
color: 0xffffff,
|
||||
@ -140,18 +138,7 @@ window.addEventListener("DOMContentLoaded", () => {
|
||||
const ambientLight = new THREE.AmbientLight(0x333333);
|
||||
scene.add(ambientLight);
|
||||
|
||||
//const floor = new Mesh(
|
||||
// new BoxGeometry(50, 100),
|
||||
// new MeshLambertMaterial({
|
||||
// color: 0xffffff,
|
||||
// depthWrite: true,
|
||||
// })
|
||||
//);
|
||||
//floor.position.y = -1.0;
|
||||
//floor.rotation.x = -Math.PI / 2;
|
||||
//scene.add(floor);
|
||||
|
||||
const grid = new GridHelper(50, 100, 0xffffff, 0xffffff);
|
||||
let grid = new GridHelper(500, 1000, 0xffffff, 0xffffff);
|
||||
scene.add(grid);
|
||||
grid.position.set(Math.round(0), 0, Math.round(0));
|
||||
scene.fog = new Fog(0xffffff, 3, 20);
|
||||
@ -249,11 +236,7 @@ window.addEventListener("DOMContentLoaded", () => {
|
||||
|
||||
let hdr_r = 0;
|
||||
function hdr_s() {
|
||||
if (hdr_r == 0) {
|
||||
hdr_r = 1;
|
||||
} else {
|
||||
hdr_r = 0;
|
||||
}
|
||||
if (hdr_r >= 2) { hdr_r = 0; } else { hdr_r++; };
|
||||
let hdr = "/img/" + hdr_r + ".hdr";
|
||||
new RGBELoader().load(hdr, function (texture) {
|
||||
texture.mapping = THREE.EquirectangularReflectionMapping;
|
||||
|
Loading…
Reference in New Issue
Block a user