Skip to content
Snippets Groups Projects
Commit c53dd504 authored by MattheoCo's avatar MattheoCo
Browse files

modification du .md de repartition

parent 84b6449b
No related branches found
No related tags found
No related merge requests found
...@@ -34,6 +34,9 @@ Ce projet est une scène 3D créée avec Three.js, présentant une nature morte ...@@ -34,6 +34,9 @@ Ce projet est une scène 3D créée avec Three.js, présentant une nature morte
## Fonctionnalités editées par Matthéo Cognet ## Fonctionnalités editées par Matthéo Cognet
### Skybox
- Un skybox avec des textures pour le sol, les murs et le plafond.
### Pièce ### Pièce
- Une pièce avec des murs, un sol et un plafond. - Une pièce avec des murs, un sol et un plafond.
- Une fenêtre avec un cadre et une porte. - Une fenêtre avec un cadre et une porte.
......
import * as THREE from 'three'; import * as THREE from 'three';
import { OrbitControls } from 'three/addons/controls/OrbitControls.js'; import {OrbitControls} from 'three/addons/controls/OrbitControls.js';
import { OBJLoader } from 'three/addons/loaders/OBJLoader.js'; import {OBJLoader} from 'three/addons/loaders/OBJLoader.js';
// Initialisation de la scène, de la caméra et du rendu // Initialisation de la scène, de la caméra et du rendu
const scene = new THREE.Scene(); const scene = new THREE.Scene();
...@@ -66,6 +66,9 @@ function init() { ...@@ -66,6 +66,9 @@ function init() {
// Call the function to load the skull // Call the function to load the skull
loadSkull(); loadSkull();
// Add the skybox
addSkybox();
} }
function createRoom() { function createRoom() {
...@@ -258,6 +261,17 @@ function loadSkull() { ...@@ -258,6 +261,17 @@ function loadSkull() {
}); });
} }
function addSkybox() {
const loader = new THREE.CubeTextureLoader();
scene.background = loader.load([
'textures/skybox/bkg1_right.png', // Right
'textures/skybox/bkg1_left.png', // Left
'textures/skybox/bkg1_top.png', // Top
'textures/skybox/bkg1_bot.png', // Bottom
'textures/skybox/bkg1_front.png', // Front
'textures/skybox/bkg1_back.png' // Back
]);
}
function loadBookStack() { function loadBookStack() {
const textureLoader = new THREE.TextureLoader(); const textureLoader = new THREE.TextureLoader();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment