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

Add new file

parent b106fffd
No related branches found
No related tags found
No related merge requests found
import * as THREE from 'three';
// lens
export function lens(param) {
const lensContiner = new THREE.Object3D();
const lensObject = new THREE.Object3D();
//cylinder mid
const cylgeometry = new THREE.CylinderGeometry(65, 65, 30, 20);
const cylmaterial = new THREE.MeshLambertMaterial({color: 0xc7c7c7});
const cylmesh = new THREE.Mesh(cylgeometry, cylmaterial);
cylmesh.rotateX(Math.PI * 1);
cylmesh.rotateY(Math.PI * 1.0);
cylmesh.rotateZ(Math.PI * 1.5);
cylmesh.position.set(0, 0 , 0);
lensObject.add(cylmesh);
//cylinder center
const cyl2geometry = new THREE.CylinderGeometry(45, 45, 31, 20);
const cyl2material = new THREE.MeshLambertMaterial({color: 0x737373});
const cyl2mesh = new THREE.Mesh(cyl2geometry, cyl2material);
cyl2mesh.rotateX(Math.PI * 1);
cyl2mesh.rotateY(Math.PI * 1.0);
cyl2mesh.rotateZ(Math.PI * 1.5);
cyl2mesh.position.set(0, 0 , 0);
lensObject.add(cyl2mesh);
// base1
const basegeometry = new THREE.BoxGeometry(29, 160, 60 );
const basemesh = new THREE.Mesh(basegeometry, cylmaterial);
basemesh.position.set(0, -40, 0);
lensObject.add(basemesh);
lensObject.scale.setX(1);
lensObject.scale.setY(1);
lensObject.scale.setZ(1);
lensObject.position.set(0, 0, 0);
lensContiner.add(lensObject);
lensContiner.rotateY(Math.PI * -1);
return lensContiner;
}
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