Commit ba3f0fab authored by Oleg Dzhimiev's avatar Oleg Dzhimiev

critical error

parent eddacfc2
...@@ -53,7 +53,8 @@ function hll_f_3d_i(i,v){ ...@@ -53,7 +53,8 @@ function hll_f_3d_i(i,v){
var mark = Data.markers[i]; var mark = Data.markers[i];
//var xyz_real = x3dom_scene_to_real(mark.align.x-base.x,mark.align.y-base.y,mark.align.z-base.z); //var xyz_real = x3dom_scene_to_real(mark.align.x-base.x,mark.align.y-base.y,mark.align.z-base.z);
var xyz_real = x3dom_scene_to_heading(mark.align.x-base.x,mark.align.y-base.y,mark.align.z-base.z); //var xyz_real = x3dom_scene_to_heading(mark.align.x-base.x,mark.align.y-base.y,mark.align.z-base.z);
var xyz_real = x3dom_scene_to_heading(mark.align.x,mark.align.y,mark.align.z);
var vec = new x3dom.fields.SFVec3f(xyz_real.x,xyz_real.y,xyz_real.z); var vec = new x3dom.fields.SFVec3f(xyz_real.x,xyz_real.y,xyz_real.z);
//var vec = new x3dom.fields.SFVec3f(mark.align.x-base.x,mark.align.y-base.y,mark.align.z-base.z); //var vec = new x3dom.fields.SFVec3f(mark.align.x-base.x,mark.align.y-base.y,mark.align.z-base.z);
......
...@@ -305,6 +305,9 @@ function x3dom_align_art(){ ...@@ -305,6 +305,9 @@ function x3dom_align_art(){
result.v[0] = result.v[0]*180/Math.PI; result.v[0] = result.v[0]*180/Math.PI;
result.v[1] = result.v[1]*180/Math.PI; result.v[1] = result.v[1]*180/Math.PI;
result.v[0] = bring_angle_to_range_deg(result.v[0],-180,180);
result.v[1] = bring_angle_to_range_deg(result.v[1],-180,180);
apply_alignment_dialog_art([0,0,0],result.v,result.count,result.error,true); apply_alignment_dialog_art([0,0,0],result.v,result.count,result.error,true);
} }
......
...@@ -87,3 +87,25 @@ function xyz_to_real_world(x,y,z){ ...@@ -87,3 +87,25 @@ function xyz_to_real_world(x,y,z){
return {x: p_rw.x, y: p_rw.y, z: p_rw.z}; return {x: p_rw.x, y: p_rw.y, z: p_rw.z};
} }
function bring_angle_to_range_deg(a,a0,a1){
var res = a;
var c = 0;
while ((res<a0)||(res>a1)){
c++;
if (res<a0) {
res += 360;
}else if (res>a1){
res -= 360;
}
if (c==100){
console.log("test");
break;
}
}
return res;
}
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