Note: The default ITS GitLab runner is a shared resource and is subject to slowdowns during heavy usage.
You can run your own GitLab runner that is dedicated just to your group if you need to avoid processing delays.

Commit 2db67b47 authored by Songan Zhang's avatar Songan Zhang
Browse files

add visualization for 3D bounding box

parent 376fe460
......@@ -362,7 +362,7 @@ function OutputBox(box) {
var v3 = box.geometry.vertices[2];
var center = getCenter(v1, v2);
this.center = new THREE.Vector3(center.z, center.x, box.centerZ);
console.log("center: ", this.center);
// console.log("center: ", this.center);
this.width = distance2D(v2, v3);
this.length = distance2D(v1, v3);
this.height = box.heightCar;
......
......@@ -63,7 +63,7 @@ function init() {
//
grid = new THREE.GridHelper( 200, 20, 0xffffff, 0xffffff );
scene.add( grid );
// scene.add( grid );
// set up renderer
renderer = new THREE.WebGLRenderer({preserveDrawingBuffer: true});
......@@ -291,6 +291,8 @@ function toggleControl(b) {
controls.enabled = b;
controls.update();
} else {
// controls.enabled = b;
// controls.update();
if (move2D) {
controls.enabled = b;
controls.update();
......@@ -505,6 +507,7 @@ function onDocumentMouseDown( event ) {
var box = intersection[0];
var closestIdx = closestPoint(anchor, box.geometry.vertices);
// console.log("closest: ", closestIdx);
// 4th node is for rotation
if (closestIdx == 4) {
isRotating = true;
rotatingBox = box;
......@@ -639,17 +642,21 @@ function moveMode( event ) {
assertRecordMode();
if (isRecording) {
controls.enabled = true;
move2D = false;
// document.getElementById( 'label' ).className = "";
document.getElementById( 'move2D' ).className = "";
document.getElementById( 'move' ).className = "selected";
controls.maxPolarAngle = 2 * Math.PI;
controls.minPolarAngle = -2 * Math.PI;
unprojectFromXZ();
evaluator.resume_3D_time();
for (var i = 0; i < boundingBoxes.length; i++) {
var box = boundingBoxes[i];
box.boundingBox.max.y = box.centerZ + box.heightCar/2;
box.boundingBox.min.y = box.centerZ - box.heightCar/2;
// console.log(box);
}
move2D = false;
}
}
......@@ -692,6 +699,12 @@ function move2DMode( event ) {
evaluator.pause_3D_time();
// for (var i = 0; i < boundingBoxes.length; i++) {
// var box = boundingBoxes[i];
// box.boundingBox.max.y = 0.00001;
// box.boundingBox.min.y = 0;
// // console.log(box);
// }
}
controls.enabled = true;
controls.update();
......
Markdown is supported
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