Commit 6f5fb850 authored by bernie wang's avatar bernie wang
Browse files

fixed camera focus

parent f85eb470
...@@ -15,7 +15,7 @@ function addRow(box) { ...@@ -15,7 +15,7 @@ function addRow(box) {
$("#object-table tbody select").last().focus(); $("#object-table tbody select").last().focus();
} }
// handler that highlights input and corresponding bounding box when input ic selected // handler that highlights input and corresponding bounding box when input is selected
$("#object-table").on('mousedown', 'tbody tr', function() { $("#object-table").on('mousedown', 'tbody tr', function() {
isMoving = false; isMoving = false;
var boxId = $(this).find('.id').text(); var boxId = $(this).find('.id').text();
...@@ -24,12 +24,17 @@ $("#object-table").on('mousedown', 'tbody tr', function() { ...@@ -24,12 +24,17 @@ $("#object-table").on('mousedown', 'tbody tr', function() {
box.select(null); box.select(null);
selectedBox = box; selectedBox = box;
var center = box.get_center(); var center = box.get_center();
// console.log(center); var current_angle = camera.rotation.z;
// camera.position.set(center.x, 100, center.y); console.log("current angle:", current_angle);
// camera.updateProjectionMatrix(); controls.target.set(center.x, 0, center.y);
// controls.update();
// controls.target.set(0, 0, 0);
camera.updateProjectionMatrix();
controls.update();
// console.log(camera.position); controls.update();
camera.rotation.z = current_angle;
console.log("camera rotation: ", camera.rotation.z);
// camera.lookAt(new THREE.Vector3(center.x,0,center.y)); // camera.lookAt(new THREE.Vector3(center.x,0,center.y));
// controls.update(); // controls.update();
......
// TODO: Fix bug where there is a phantom box in the next frame when you delete a box
//
if ( ! Detector.webgl ) Detector.addGetWebGLMessage(); if ( ! Detector.webgl ) Detector.addGetWebGLMessage();
......
Supports Markdown
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