Skip to content
Snippets Groups Projects
GCOL.js 3.71 KiB
	import * as THREE from 'three';

	// GCOL
	export function GCOL(param) {
		const GCOLObject = new THREE.Object3D();
		const GCOLContiner = new THREE.Object3D();
		
		const materialGrey = new THREE.MeshLambertMaterial({color: 0xf0f0f0});
		const materialDarkGrey = new THREE.MeshLambertMaterial({color: 0x8c8c8c});
		const materialBlack= new THREE.MeshLambertMaterial({color: 0x000000});
		
		// box down
		const orangegeometry = new THREE.CylinderGeometry(200, 200, 300, 15);
		const orangegeometrymesh = new THREE.Mesh(orangegeometry, materialGrey);
		orangegeometrymesh.position.set(0, -350, 0);		
		GCOLObject.add(orangegeometrymesh);
		
		// box large down
		const blackgeometry = new THREE.CylinderGeometry(230, 230, 50, 15);
		const blackgeometrymesh = new THREE.Mesh(blackgeometry, materialGrey);
		blackgeometrymesh.position.set(0, -200, 0);		
		GCOLObject.add(blackgeometrymesh);	
		
		//base zig
		const d15geometry = new THREE.CylinderGeometry(60, 60, 50, 25);
		const d15mesh = new THREE.Mesh(d15geometry, materialGrey);
		d15mesh.position.set(0, -175, 0);
		d15mesh.rotateX(Math.PI * 1);
		GCOLObject.add(d15mesh);		
		
		// zigrinatura
		const d4geometry = new THREE.CylinderGeometry(60, 60, 100, 15);
		const textureLoader = new THREE.TextureLoader();
		const texture = textureLoader.load('./components/flsc_texture.png');	
		texture.wrapS = texture.wrapT = THREE.RepeatWrapping;
		texture.repeat.set(5, 40);		
		const material = new THREE.MeshBasicMaterial({ map: texture });		
		const d4mesh = new THREE.Mesh(d4geometry, material);
		d4mesh.rotateX(Math.PI * 1);
		d4mesh.rotateY(Math.PI * 1);
		d4mesh.rotateZ(Math.PI * 1);
		d4mesh.position.set(0, -100 , 0);			
		GCOLObject.add(d4mesh);		
		
		// up zigrinatura
		const d5geometry = new THREE.CylinderGeometry(70, 70, 50, 15);
		const d5mesh = new THREE.Mesh(d5geometry, materialGrey);
		d5mesh.rotateX(Math.PI * 1);
		d5mesh.rotateY(Math.PI * 1);
		d5mesh.rotateZ(Math.PI * 1);
		d5mesh.position.set(0, -30 , 0);			
		GCOLObject.add(d5mesh);	
		
		//cil support1
		const d11geometry = new THREE.CylinderGeometry(12, 12, 250, 25);
		const d11mesh = new THREE.Mesh(d11geometry, materialGrey);
		d11mesh.position.set(-125, -50, 75);
		GCOLObject.add(d11mesh);	
		
		//cil support2
		const d12geometry = new THREE.CylinderGeometry(12, 12, 250, 25);
		const d12mesh = new THREE.Mesh(d12geometry, materialGrey);
		d12mesh.position.set(125, -50, 75);
		GCOLObject.add(d12mesh);				
		
		//cil support3
		const d13geometry = new THREE.CylinderGeometry(12, 12, 250, 25);
		const d13mesh = new THREE.Mesh(d13geometry, materialGrey);
		d13mesh.position.set(0, -50, -125);
		GCOLObject.add(d13mesh);				
	
		//internal block
		const d16geometry = new THREE.CylinderGeometry(7, 7, 260, 15);
		const d16mesh = new THREE.Mesh(d16geometry, materialGrey);
		d16mesh.position.set(0, -50, 0);
		d16mesh.rotateX(Math.PI * 1);
		GCOLObject.add(d16mesh);	
		
		//base triengle
		const trienglegeometry = new THREE.CylinderGeometry(190, 190, 30, 3);
		const trienglemesh = new THREE.Mesh(trienglegeometry, materialDarkGrey);
		trienglemesh.position.set(0, 80, 0);
		trienglemesh.rotateX(Math.PI * 1);
		GCOLObject.add(trienglemesh);		
		
		//up1
		const up1geometry = new THREE.CylinderGeometry(30, 30, 70, 15);
		const up1mesh = new THREE.Mesh(up1geometry, materialGrey);
		up1mesh.position.set(0, 120, 0);
		up1mesh.rotateX(Math.PI * 1);
		GCOLObject.add(up1mesh);	
		
		//up2
		const up2geometry = new THREE.CylinderGeometry(30, 30, 110, 15);
		const up2mesh = new THREE.Mesh(up2geometry, materialDarkGrey);
		up2mesh.position.set(0, 210, 0);
		up2mesh.rotateX(Math.PI * 1);
		GCOLObject.add(up2mesh);			
		

		GCOLObject.position.set(0, 0, 0);
		GCOLContiner.add(GCOLObject);
		GCOLContiner.rotateY(Math.PI * -0.5);
		return GCOLContiner;
	}