1.
msheOpas[0] = groups[0].clone(); msheOpas[0].material = msheOpas[0].material.clone(); msheOpas[0].material.opacity = 0.5
msheOpas[0].scale.set(0.9,0.9,0.9)
msheOpas[1] = groups[1].clone(); msheOpas[1].material = msheOpas[1].material.clone(); msheOpas[1].material.opacity = 0.5
msheOpas[0].scale.set(0.9,0.9,0.9)
msheOpas[2] = groups[2].clone(); msheOpas[2].material = msheOpas[2].material.clone(); msheOpas[2].material.opacity = 0.5
msheOpas[0].scale.set(0.9,0.9,0.9)
2.
var rad = groupCubeShowLen/2
var height ;
var rot = new THREE.Vector3()
if (size.x === 0)
size.x = groupCubeShowLen;
else{
size.x += cubeShowLen;
height = size.x
rot.z = Math.PI/2
}
if (size.y === 0)
size.y = groupCubeShowLen;
else{
size.y += cubeShowLen;
height = size.y
}
if (size.z === 0)
size.z = groupCubeShowLen;
else{
size.z += cubeShowLen;
height = size.z
rot.x = Math.PI/2
}
if ((lady !== true)){
var geometry = new THREE.BoxGeometry(size.x, size.y, size.z);
var material = arrMat.pop()
var group = new Group(geometry, material, posFrom, pos, s, e);
// var geometry = new THREE.CylinderGeometry(rad,rad,height, 32);
// var material = arrMat.pop()
// var group = new Group(geometry, material, posFrom, pos, s, e);
// group.rotation.set(rot.x, rot.y, rot.z)
console.log('group', group.position, group.rotation)
scene.add(group); groups.push(group);
// var edges = new THREE.LineSegments(new THREE.EdgesGeometry(group.geometry),
// new THREE.LineBasicMaterial({ color: 0x888888 , linewidth: 1}));
// edges.visible = false;
// group.add(edges); group.edges = edges;
}
if (lady === true) {
var group = new Group( new THREE.BoxGeometry(size.x, size.y, size.z),
new THREE.MeshBasicMaterial({color:colorGroupLady, transparent:true}), posFrom, pos, s, e);
scene.add(group); groups.push(group);
group.lady = true;
// var edges = new THREE.LineSegments(new THREE.EdgesGeometry(group.geometry),
// new THREE.LineBasicMaterial({ color: 0x888888 , linewidth: 1}));
// group.add(edges); group.edges = edges;