diff --git a/components/src/cm.js b/components/src/cm.js new file mode 100644 index 0000000000000000000000000000000000000000..16846f9cf714fc771b66ef140562b56256e8edb9 --- /dev/null +++ b/components/src/cm.js @@ -0,0 +1,38 @@ + import * as THREE from 'three'; + + // current monitor + export function cm(param) { + const cmContiner = new THREE.Object3D(); + const cmObject = new THREE.Object3D(); + + //cylinder mid + const cylgeometry = new THREE.CylinderGeometry(65, 65, 30, 20); + const cylmaterial = new THREE.MeshLambertMaterial({color: 0x7dbab2}); + 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); + cmObject.add(cylmesh); + + //cylinder center + const cyl2geometry = new THREE.CylinderGeometry(35, 35, 31, 20); + const cyl2material = new THREE.MeshLambertMaterial({color: 0x348c81}); + 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); + cmObject.add(cyl2mesh); + + + cmObject.scale.setX(1); + cmObject.scale.setY(1); + cmObject.scale.setZ(1); + cmObject.position.set(0, 0, 0); + cmContiner.add(cmObject); + cmContiner.rotateY(Math.PI * -1); + + + return cmContiner; + }