- Add Class Map
   - Add plane a bottom
This commit is contained in:
Hugo Bourgeon
2024-08-20 16:36:35 +02:00
parent 80f6fff1e0
commit 2543e1ea3b
14 changed files with 121089 additions and 807 deletions

View File

@ -3,15 +3,17 @@
/* ::: :::::::: */
/* main.js :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */
/* By: hubourge <hubourge@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/08/18 00:53:53 by edbernar #+# #+# */
/* Updated: 2024/08/19 23:08:38 by edbernar ### ########.fr */
/* Updated: 2024/08/20 16:11:26 by hubourge ### ########.fr */
/* */
/* ************************************************************************** */
import * as THREE from 'three';
import { Player } from './class/Player'
import { Map } from './class/Map'
import { OrbitControls } from 'three/examples/jsm/Addons.js';
function createBarPlayer(color)
{
@ -41,18 +43,17 @@ function createMap()
const scene = new THREE.Scene();
const map = new Map(scene, 13);
const bar = createBarPlayer(0xed56ea);
const renderer = new THREE.WebGLRenderer({antialias: true});
const player = new Player(bar);
const spotLight = new THREE.SpotLight(0xffffff, 10000, 0, Math.PI / 4);
const ambiantLight = new THREE.AmbientLight(0xffffff, 1);
const map = createMap();
scene.add(player.object);
scene.add(ambiantLight);
spotLight.position.set(0, 100, 0);
scene.add(spotLight);
scene.add(map);
scene.background = new THREE.Color(0x1a1a1a);
renderer.setSize(window.innerWidth, window.innerHeight);
document.body.appendChild(renderer.domElement);