Commit 80681b78 authored by Oleg Dzhimiev's avatar Oleg Dzhimiev

tmp changes

parent 312c254f
...@@ -52,10 +52,11 @@ function hll_f_3d_i(i,v){ ...@@ -52,10 +52,11 @@ function hll_f_3d_i(i,v){
var base = Data.camera; var base = Data.camera;
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 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);
var res = Math.atan2(vec.x,-vec.z)*180/Math.PI + v[2]; var res = Math.atan2(vec.x,-vec.z)*180/Math.PI + v[2];
if (res> 180) res = res - 360; if (res> 180) res = res - 360;
...@@ -195,6 +196,7 @@ function hll_w_i(i,v){ ...@@ -195,6 +196,7 @@ function hll_w_i(i,v){
res = (res>1)?1:res; res = (res>1)?1:res;
return res; return res;
} }
/** /**
......
...@@ -744,6 +744,24 @@ function x3dom_scene_to_real(x,y,z){ ...@@ -744,6 +744,24 @@ function x3dom_scene_to_real(x,y,z){
} }
/*
* unapply tilt and roll only, keep heading
*/
function x3dom_scene_to_heading(x,y,z){
//var R0 = Data.camera.Matrices.R0;
var R0 = Data.camera.Matrices.RC_w.inverse();
var p_w = new x3dom.fields.SFVec3f(x,y,z);
var p_rw = R0.multMatrixVec(p_w);
return {
x: p_rw.x,
y: p_rw.y,
z: p_rw.z
}
}
function x3dom_real_to_scene(x,y,z){ function x3dom_real_to_scene(x,y,z){
var R0i = Data.camera.Matrices.R0.inverse(); var R0i = Data.camera.Matrices.R0.inverse();
......
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