Commit da183e17 authored by Oleg Dzhimiev's avatar Oleg Dzhimiev

1. fixed incorrect zFar (when mouse wasalready in the scene) 2. inverted scene...

1. fixed incorrect zFar (when mouse wasalready in the scene) 2. inverted scene rotation 3. fixed coordinates for extra models
parent b825e1f0
...@@ -369,9 +369,9 @@ function manualposor_refresh_content(){ ...@@ -369,9 +369,9 @@ function manualposor_refresh_content(){
'<tr class=\'mpr_content\'>', '<tr class=\'mpr_content\'>',
' <td align=\'center\' class=\'mpr_name mpr_modelname\'>'+name+'</td>', ' <td align=\'center\' class=\'mpr_name mpr_modelname\'>'+name+'</td>',
' <td><input type=\'checkbox\' class=\'mpr_hide\'></td>', ' <td><input type=\'checkbox\' class=\'mpr_hide\'></td>',
' <td><input type=\'text\' class=\'mpr_input mpr_tra mpr_x\' value=\''+tra_tra_rw.x+'\' \></td>', ' <td><input type=\'text\' class=\'mpr_input mpr_tra mpr_x\' value=\''+tra_tra_rw.x.toFixed(3)+'\' \></td>',
' <td><input type=\'text\' class=\'mpr_input mpr_tra mpr_y\' value=\''+tra_tra_rw.y+'\' \></td>', ' <td><input type=\'text\' class=\'mpr_input mpr_tra mpr_y\' value=\''+tra_tra_rw.y.toFixed(3)+'\' \></td>',
' <td><input type=\'text\' class=\'mpr_input mpr_tra mpr_z\' value=\''+tra_tra_rw.z+'\' \></td>', ' <td><input type=\'text\' class=\'mpr_input mpr_tra mpr_z\' value=\''+tra_tra_rw.z.toFixed(3)+'\' \></td>',
' <td><input type=\'text\' class=\'mpr_input mpr_rot mpr_h\' value=\''+htr.yaw.toFixed(2)+'\' \></td>', ' <td><input type=\'text\' class=\'mpr_input mpr_rot mpr_h\' value=\''+htr.yaw.toFixed(2)+'\' \></td>',
' <td><input type=\'text\' class=\'mpr_input mpr_rot mpr_t\' value=\''+htr.pitch.toFixed(2)+'\' \></td>', ' <td><input type=\'text\' class=\'mpr_input mpr_rot mpr_t\' value=\''+htr.pitch.toFixed(2)+'\' \></td>',
' <td><input type=\'text\' class=\'mpr_input mpr_rot mpr_r\' value=\''+htr.roll.toFixed(2)+'\' \></td>', ' <td><input type=\'text\' class=\'mpr_input mpr_rot mpr_r\' value=\''+htr.roll.toFixed(2)+'\' \></td>',
...@@ -453,10 +453,15 @@ function manualposor_refresh_content(){ ...@@ -453,10 +453,15 @@ function manualposor_refresh_content(){
}; };
distance = Math.sqrt(dp_rw.x*dp_rw.x+dp_rw.z*dp_rw.z); distance = Math.sqrt(dp_rw.x*dp_rw.x+dp_rw.z*dp_rw.z);
angle = 180/Math.PI*Math.atan2(dp_rw.x,-dp_rw.z);
if (dp_rw.z!=0){ if (dp_rw.z!=0){
angle = 180/Math.PI*Math.atan2(dp_rw.x,-dp_rw.z); angle = 180/Math.PI*Math.atan2(dp_rw.x,-dp_rw.z);
} }
console.log("Angle-Distance: "+angle+" "+distance);
var dp_r = x3dom_real_to_scene(dp_rw.x,dp_rw.y,dp_rw.z); var dp_r = x3dom_real_to_scene(dp_rw.x,dp_rw.y,dp_rw.z);
var new_tra = [dp_r.x,dp_r.y,dp_r.z].join(","); var new_tra = [dp_r.x,dp_r.y,dp_r.z].join(",");
......
...@@ -419,13 +419,6 @@ function deep_init(){ ...@@ -419,13 +419,6 @@ function deep_init(){
if (!Scene._X3DOM_SCENE_INIT_DONE&&(cnt==0)){ if (!Scene._X3DOM_SCENE_INIT_DONE&&(cnt==0)){
var ss = 10/Scene.element.runtime.viewpoint().getFar();
ss = ss.toFixed(4);
$("#shiftspeed").val(ss);
$("#shiftspeed").change();
//Scene.initResize(); //Scene.initResize();
// now then all shapes are parsed and accessible // now then all shapes are parsed and accessible
...@@ -433,11 +426,25 @@ function deep_init(){ ...@@ -433,11 +426,25 @@ function deep_init(){
Scene._X3DOM_SCENE_INIT_DONE = true; Scene._X3DOM_SCENE_INIT_DONE = true;
Scene._X3DOM_SCENE_INIT_BACK_DONE = true; Scene._X3DOM_SCENE_INIT_BACK_DONE = true;
x3d_setShiftSpeed();
} }
}; };
} }
function x3d_setShiftSpeed(){
var ss = 10/Scene.element.runtime.viewpoint().getFar();
ss = ss.toFixed(4);
$("#shiftspeed").val(ss);
$("#shiftspeed").change();
}
function x3d_initial_camera_placement(mode){ function x3d_initial_camera_placement(mode){
if (mode==undefined){ if (mode==undefined){
...@@ -612,6 +619,7 @@ function x3d_events(){ ...@@ -612,6 +619,7 @@ function x3d_events(){
},true); },true);
elem.addEventListener('mousedown',function(){ elem.addEventListener('mousedown',function(){
x3d_setShiftSpeed();
elem.addEventListener('mousemove',x3d_mouseMove,true); elem.addEventListener('mousemove',x3d_mouseMove,true);
}); });
......
This diff is collapsed.
...@@ -843,8 +843,6 @@ function x3dom_update_map(){ ...@@ -843,8 +843,6 @@ function x3dom_update_map(){
// uses globals // uses globals
function x3dom_setViewpoint(m){ function x3dom_setViewpoint(m){
//console.log("Setting a viewpoint");
var Q = new x3dom.fields.Quaternion(0, 0, 1, 0); var Q = new x3dom.fields.Quaternion(0, 0, 1, 0);
Q.setValue(m); Q.setValue(m);
var AA = Q.toAxisAngle(); var AA = Q.toAxisAngle();
......
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