27 lines
541 B
JavaScript
27 lines
541 B
JavaScript
import { Env } from "./Env.js";
|
|
import { Cube } from "./Cube.js";
|
|
import { Plane } from "./Plane.js";
|
|
|
|
window.addEventListener("load", () => main());
|
|
|
|
const main = () => {
|
|
const env = new Env();
|
|
|
|
document.body.appendChild(env.getDomElement());
|
|
|
|
const plan = new Plane(
|
|
window.innerWidth / 50,
|
|
10,
|
|
THREE.Color.NAMES.white,
|
|
THREE.Color.NAMES.black
|
|
);
|
|
env.addToScene(plan);
|
|
|
|
const animate = () => {
|
|
requestAnimationFrame(animate);
|
|
|
|
env.render();
|
|
};
|
|
|
|
animate();
|
|
};
|