Skip to content
Snippets Groups Projects
Commit 3c98a1d6 authored by Lucio Zambon's avatar Lucio Zambon
Browse files

Add new file

parent 47ecb151
No related branches found
No related tags found
No related merge requests found
import * as THREE from 'three';
// Control rack
export function rc(width=800, height=2500, depth=600) {
const rc_rackObject = new THREE.Object3D();
const bluematerial = new THREE.MeshLambertMaterial({color: 0x0053d9});
const softbluematerial = new THREE.MeshLambertMaterial({color: 0x2b7cff});
const target = new THREE.MeshLambertMaterial({color: 0xfbe928});
const materialGreyDark= new THREE.MeshLambertMaterial({color: 0x9d9d9d});
const materialGreyMedium= new THREE.MeshLambertMaterial({color: 0x636363});
//rack
const rrgeometry = new THREE.BoxGeometry(width, height, depth);
const rrmesh = new THREE.Mesh(rrgeometry, softbluematerial);
rrmesh.position.set( 0, 0 , -10);
rc_rackObject.add(rrmesh);
//front yellow target
const Ftarget = new THREE.BoxGeometry(2, 90, 500);
const Ftargetmesh = new THREE.Mesh(Ftarget, target);
Ftargetmesh.position.set( -451, 1200 , -15);
rc_rackObject.add(Ftargetmesh);
//Rear yellow target
const Rtarget = new THREE.BoxGeometry(2, 90, 500);
const Rtargetmesh = new THREE.Mesh(Rtarget, target);
Rtargetmesh.position.set( 401, 1200 , -15);
rc_rackObject.add(Rtargetmesh);
//edge le
const llegeometry = new THREE.BoxGeometry(width-750, height, depth-550);
const llemesh = new THREE.Mesh(llegeometry, bluematerial);
llemesh.position.set( -425, 0 , -285);
rc_rackObject.add(llemesh);
//edge re
const lregeometry = new THREE.BoxGeometry(width-750, height, depth-550);
const lremesh = new THREE.Mesh(lregeometry, bluematerial);
lremesh.position.set( -425, 0 , 265);
rc_rackObject.add(lremesh);
//edge ue
const luegeometry = new THREE.BoxGeometry(width-750, height-2450, depth-50);
const luemesh = new THREE.Mesh(luegeometry, bluematerial);
luemesh.position.set( -425, 1225 , -7);
rc_rackObject.add(luemesh);
//edge de
const ldegeometry = new THREE.BoxGeometry(width-750, height-2450, depth-50);
const ldemesh = new THREE.Mesh(ldegeometry, bluematerial);
ldemesh.position.set( -425, -1230 , -7);
rc_rackObject.add(ldemesh);
//borderEC down
const borderECgeometry = new THREE.BoxGeometry(10, 400, 600);
const borderECgeometrymesh = new THREE.Mesh(borderECgeometry, materialGreyDark);
borderECgeometrymesh.position.set( -400, -250 , -10);
rc_rackObject.add(borderECgeometrymesh);
//EC1 down
const EC1geometry = new THREE.BoxGeometry(10, 350, 40);
const EC1geometrymesh = new THREE.Mesh(EC1geometry, materialGreyMedium);
EC1geometrymesh.position.set( -402, -250 , -200);
rc_rackObject.add(EC1geometrymesh);
//EC2 down
const EC2geometry = new THREE.BoxGeometry(10, 350, 40);
const EC2geometrymesh = new THREE.Mesh(EC2geometry, materialGreyMedium);
EC2geometrymesh.position.set( -402, -250 , -150);
rc_rackObject.add(EC2geometrymesh);
//EC2 down
const EC3geometry = new THREE.BoxGeometry(10, 350, 40);
const EC3geometrymesh = new THREE.Mesh(EC3geometry, materialGreyMedium);
EC3geometrymesh.position.set( -402, -250 , -100);
rc_rackObject.add(EC3geometrymesh);
//borderEC up
const borderupECgeometry = new THREE.BoxGeometry(10, 400, 600);
const borderupECgeometrymesh = new THREE.Mesh(borderupECgeometry, materialGreyDark);
borderupECgeometrymesh.position.set( -400, 250 , -10);
rc_rackObject.add(borderupECgeometrymesh);
//EC1 up
const EC1geometryup = new THREE.BoxGeometry(10, 350, 40);
const EC1geometryupmesh = new THREE.Mesh(EC1geometryup, materialGreyMedium);
EC1geometryupmesh.position.set( -402, 250 , -200);
rc_rackObject.add(EC1geometryupmesh);
//EC2 up
const EC2geometryup = new THREE.BoxGeometry(10, 350, 40);
const EC2geometryupmesh = new THREE.Mesh(EC2geometryup, materialGreyMedium);
EC2geometryupmesh.position.set( -402, 250 , -150);
rc_rackObject.add(EC2geometryupmesh);
//EC2 up
const EC3geometryup = new THREE.BoxGeometry(10, 350, 40);
const EC3geometryupmesh = new THREE.Mesh(EC3geometryup, materialGreyMedium);
EC3geometryupmesh.position.set( -402, 250 , -100);
rc_rackObject.add(EC3geometryupmesh);
return rc_rackObject;
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment