Code viewer for World: New World
import * as THREE from "three";
import { DirectionalLight } from "three";


const scene = new THREE.Scene();

const geometry = new THREE.BoxGeometry(3, 1, 3);
const material = new THREE.MeshLambertMaterial({ color: 0xfb8e00 });
const mesh = new THREE.Mesh(geometry, material);
mesh.position.set(0, 0, 0);
scene.add(mesh);

const light = new THREE.AmbientLight(0xffffff, 0,6);
scene.add(light);

const directionL = new THREE.DirectionalLight(0xffffff, 0.6);
DirectionalLight.position.set(10, 20, 0);
scene.add(directionL);

const width = 10;
const height = width * (window.innerHeight / window.innerWidth);
const camera = new THREE.OrthographicCamera(
    width / -2,
    width / 2,
    height / 2,
    height / -2,
    1,
    100
);

camera.position.set(4,4,4);
camera.lookAt(0,0,0);

const renderer = new THREE.WebGLRenderer({antialias: true});
renderer.setSize(window.innerWidth, window.innerHeight);

document.body.appendChild(renderer.domElement);