Added the firsts textures on signs
Used to present the schools I attended French version only, but others languages will be added later
This commit is contained in:
BIN
src/objects/textures/epid.png
Normal file
BIN
src/objects/textures/epid.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.5 MiB |
BIN
src/objects/textures/iutCalais.png
Normal file
BIN
src/objects/textures/iutCalais.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.0 MiB |
@@ -2,6 +2,7 @@ import * as THREE from 'three';
|
||||
import * as MathUtils from 'three/src/math/MathUtils.js';
|
||||
import { createGround } from '../objects/ground.js';
|
||||
import {loadModel} from './import.js';
|
||||
const textureLoader = new THREE.TextureLoader();
|
||||
|
||||
|
||||
function alignGround(ground, MovingObject) {
|
||||
@@ -335,31 +336,26 @@ export async function addAssetsOnScene(scene){
|
||||
/* --------------------
|
||||
ADDING SIGNS
|
||||
-------------------- */
|
||||
const sign = await loadModel('src/objects/models/sign.gltf');
|
||||
const sign = await loadModel('src/objects/models/sign.gltf');//Sign model prepared
|
||||
sign.scene.scale.set(0.08,0.08,0.08);
|
||||
sign.scene.position.x = 10;
|
||||
sign.scene.position.y = 1.36;
|
||||
sign.scene.rotateOnWorldAxis(new THREE.Vector3(1,0,0), MathUtils.degToRad(90));
|
||||
sign.scene.rotateOnWorldAxis(new THREE.Vector3(0,0,1), MathUtils.degToRad(-90));
|
||||
alignGround(ground, sign.scene);
|
||||
scene.add( sign.scene );
|
||||
|
||||
const geometry = new THREE.PlaneGeometry(2.95, 1.55);
|
||||
const material = new THREE.MeshBasicMaterial({ color: 0x000000 });
|
||||
const plane = new THREE.Mesh(geometry, material);
|
||||
plane.rotateOnWorldAxis(new THREE.Vector3(1,0,0), MathUtils.degToRad(90));
|
||||
plane.position.set(10.06, 1.347, 1.65);
|
||||
scene.add(plane);
|
||||
const SignPlanegeometry = new THREE.PlaneGeometry(2.95, 1.55);
|
||||
const signPictures = ['src/objects/textures/epid.png', 'src/objects/textures/iutCalais.png']
|
||||
|
||||
|
||||
for(let i=1; i<3; i++){
|
||||
for(let i=0; i<2; i++){
|
||||
const signCopy = sign.scene.clone();
|
||||
signCopy.position.x += i*5;
|
||||
signCopy.position.x = 10 + i*5;
|
||||
signCopy.position.y = 1.36;
|
||||
scene.add( signCopy );
|
||||
|
||||
const planeClone = plane.clone();
|
||||
planeClone.position.x += i*5;
|
||||
scene.add( planeClone );
|
||||
const signPlaneMaterial = new THREE.MeshBasicMaterial({ map:textureLoader.load(signPictures[i]) });
|
||||
const signPlane = new THREE.Mesh(SignPlanegeometry, signPlaneMaterial);
|
||||
signPlane.rotateOnWorldAxis(new THREE.Vector3(1,0,0), MathUtils.degToRad(90));
|
||||
signPlane.position.set(10.06 + i*5, 1.347, 1.65);//Determined by hand
|
||||
scene.add(signPlane);
|
||||
}
|
||||
|
||||
/* --------------------
|
||||
|
||||
Reference in New Issue
Block a user