|
@@ -18,6 +18,7 @@ const colors = {
|
|
|
2: 0xffffff,//0x00ff80, //可见
|
|
|
3: 0xffc23b,//0xff3158, //不可见
|
|
|
4: 0xffffff, //
|
|
|
+ highlight: 0x0000ff,
|
|
|
}
|
|
|
|
|
|
export class Volume extends THREE.Object3D {
|
|
@@ -141,7 +142,7 @@ export class BoxVolume extends Volume{
|
|
|
|
|
|
boxFrameGeometry.vertices.push(
|
|
|
|
|
|
- // bottom
|
|
|
+ /* // bottom
|
|
|
new Vector3(-0.5, -0.5, 0.5),
|
|
|
new Vector3(0.5, -0.5, 0.5),
|
|
|
new Vector3(0.5, -0.5, 0.5),
|
|
@@ -167,8 +168,34 @@ export class BoxVolume extends Volume{
|
|
|
new Vector3(0.5, -0.5, -0.5),
|
|
|
new Vector3(0.5, 0.5, -0.5),
|
|
|
new Vector3(-0.5, -0.5, -0.5),
|
|
|
+ new Vector3(-0.5, 0.5, -0.5), */
|
|
|
+ // bottom
|
|
|
+ new Vector3(-0.5, 0.5,-0.5,),
|
|
|
+ new Vector3(0.5, 0.5, -0.5),
|
|
|
+ new Vector3(0.5, 0.5,-0.5),
|
|
|
+ new Vector3(0.5, -0.5,-0.5),
|
|
|
+ new Vector3(0.5, -0.5, -0.5),
|
|
|
+ new Vector3(-0.5, -0.5, -0.5),
|
|
|
+ new Vector3(-0.5, -0.5,-0.5),
|
|
|
+ new Vector3(-0.5, 0.5,-0.5),
|
|
|
+ // top
|
|
|
+ new Vector3(-0.5, 0.5, 0.5),
|
|
|
+ new Vector3(0.5, 0.5, 0.5),
|
|
|
+ new Vector3(0.5, 0.5, 0.5),
|
|
|
+ new Vector3(0.5, -0.5, 0.5),
|
|
|
+ new Vector3(0.5, -0.5, 0.5),
|
|
|
+ new Vector3(-0.5, -0.5, 0.5),
|
|
|
+ new Vector3(-0.5, -0.5, 0.5),
|
|
|
+ new Vector3(-0.5, 0.5, 0.5),
|
|
|
+ // sides
|
|
|
new Vector3(-0.5, 0.5, -0.5),
|
|
|
-
|
|
|
+ new Vector3(-0.5, 0.5, 0.5),
|
|
|
+ new Vector3(0.5, 0.5, -0.5),
|
|
|
+ new Vector3(0.5, 0.5, 0.5),
|
|
|
+ new Vector3(0.5, -0.5, -0.5),
|
|
|
+ new Vector3(0.5, -0.5, 0.5),
|
|
|
+ new Vector3(-0.5, -0.5, -0.5),
|
|
|
+ new Vector3(-0.5, -0.5, 0.5),
|
|
|
);
|
|
|
|
|
|
}
|
|
@@ -196,11 +223,24 @@ export class BoxVolume extends Volume{
|
|
|
//this.frame = new THREE.LineSegments(boxFrameGeometry, new THREE.LineBasicMaterial({color: colors[this.clipTask], opacity:LineOpacity.default/* 0xff2050 */}));
|
|
|
this.frame = LineDraw.createFatLine(
|
|
|
boxFrameGeometry.vertices,
|
|
|
- {dashed:true, dashSize:0.1, gapSize:0.1, opacity: 0.5, color: colors[this.clipTask], opacity:LineOpacity.default, lineWidth:2, dontAlwaysSeen:true} )
|
|
|
-
|
|
|
+ {dashed:true, dashSize:0.02, gapSize:0.02, opacity: 0.5, lineWidth:2, color: colors[this.clipTask], dontAlwaysSeen:true} )
|
|
|
+
|
|
|
+ this.frameHorizon =
|
|
|
+ LineDraw.createFatLine(
|
|
|
+ boxFrameGeometry.vertices.slice(0,16),
|
|
|
+ { opacity: 1, lineWidth:2, color: colors['highlight'], dontAlwaysSeen:true} )
|
|
|
+ this.frameVertical = LineDraw.createFatLine(
|
|
|
+ boxFrameGeometry.vertices.slice(16,24),
|
|
|
+ { opacity: 1, lineWidth:2, color: colors['highlight'], uncontinuous:true, dontAlwaysSeen:true} )
|
|
|
+ this.frameHorizon.visible = false
|
|
|
+ this.frameVertical.visible = false
|
|
|
+ this.add(this.frameHorizon);
|
|
|
+ this.add(this.frameVertical);
|
|
|
+
|
|
|
+
|
|
|
+ this.boxFrameGeometry = boxFrameGeometry
|
|
|
// this.frame.mode = THREE.Lines;
|
|
|
- this.add(this.frame);
|
|
|
- this.frame.computeLineDistances()
|
|
|
+ this.add(this.frame);
|
|
|
this.update();
|
|
|
}
|
|
|
|
|
@@ -220,7 +260,7 @@ export class BoxVolume extends Volume{
|
|
|
this.box.material.color.set(colors[this.clipTask])
|
|
|
this.frame.material.color.set(colors[this.clipTask])
|
|
|
this.frame.material.opacity = this.selected ? LineOpacity.selected : LineOpacity.default
|
|
|
- this.frame.material.lineWidth = this.selected ? 2 : 1
|
|
|
+
|
|
|
}
|
|
|
|
|
|
raycast (raycaster, intersects) {
|