- Timestamp:
- 04/18/20 20:18:36 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
js/human_3d_alignment/src/visualization/partmeshfactory.js
r881 r911 36 36 * @returns {PartMesh} info about part mesh 37 37 */ 38 getNewSphereMesh(part, sphereRadius, segments, applyScale) {38 getNewSphereMesh(part, color, sphereRadius, segments, applyScale) { 39 39 let geometry = new THREE.SphereGeometry(sphereRadius, segments, segments); 40 let material = this.transformations.getNewMaterial( 41 part.get_vcolor().get_x(), 42 part.get_vcolor().get_y(), 43 part.get_vcolor().get_z()); 40 let material = this.transformations.getNewMaterial(color); 44 41 let mesh = null; 45 42 if (applyScale) { … … 94 91 * @returns {PartMesh} info about part mesh 95 92 */ 96 getNewBoxMesh(part ) {93 getNewBoxMesh(part, color) { 97 94 let geometry = new THREE.BoxGeometry(2, 2, 2); 98 95 geometry.scale( … … 101 98 part.get_scale().get_z()); 102 99 103 let material = this.transformations.getNewMaterial( 104 part.get_vcolor().get_x(), 105 part.get_vcolor().get_y(), 106 part.get_vcolor().get_z()); 100 let material = this.transformations.getNewMaterial(color); 107 101 let mesh = new THREE.Mesh(geometry, material); 108 102 mesh.position.set( … … 133 127 * @returns {PartMesh} info about part mesh 134 128 */ 135 getNewCylinderMesh(part ) {129 getNewCylinderMesh(part, color) { 136 130 let geometry = new THREE.CylinderGeometry(1, 1, 2, 32); 137 let material = this.transformations.getNewMaterial( 138 part.get_vcolor().get_x(), 139 part.get_vcolor().get_y(), 140 part.get_vcolor().get_z()); 131 let material = this.transformations.getNewMaterial(color); 141 132 142 133 geometry.scale( … … 181 172 * @returns {PartMesh} info about part mesh 182 173 */ 183 create(part ) {174 create(part, color) { 184 175 185 176 let shape = part.get_shape(); … … 187 178 return this.getNewSphereMesh( 188 179 part, 180 color, 189 181 this.config.ellipsoidShape.radius, 190 182 this.config.ellipsoidShape.segments, true); 191 183 } 192 184 else if (this.partShapes['SHAPE_CUBOID'].value == shape) { 193 return this.getNewBoxMesh(part );185 return this.getNewBoxMesh(part, color); 194 186 } 195 187 else if (this.partShapes['SHAPE_CYLINDER'].value == shape) { 196 return this.getNewCylinderMesh(part );188 return this.getNewCylinderMesh(part, color); 197 189 } 198 190 return this.getNewSphereMesh( 199 191 part, 192 color, 200 193 this.config.defaultShape.radius, 201 194 this.config.defaultShape.segments,
Note: See TracChangeset
for help on using the changeset viewer.