Commit 037b0a85 authored by Oleg Dzhimiev's avatar Oleg Dzhimiev

fixed setting height from map

parent 155dff77
...@@ -456,14 +456,20 @@ function x3dom_translation_v2(x,y,z){ ...@@ -456,14 +456,20 @@ function x3dom_translation_v2(x,y,z){
function x3dom_altelev(alt,elev){ function x3dom_altelev(alt,elev){
console.log("setting elevation");
//x3dom_matrix_test(); //x3dom_matrix_test();
var mat = Scene.element.runtime.viewMatrix().inverse(); var mat = Scene.element.runtime.viewMatrix().inverse();
var R0 = Data.camera.Matrices.R0; var R0 = Data.camera.Matrices.R0;
//var T = x3dom_toYawPitchRoll(); //var T = x3dom_toYawPitchRoll();
var from = mat.e3(); var from = mat.e3();
from.y = alt;
//from.y = alt;
var from_tmp = R0.multMatrixVec(from);
from_tmp.y = alt;
from = R0.inverse().multMatrixVec(from_tmp);
var mat = R0.mult(mat); var mat = R0.mult(mat);
var ypr = x3dom_YawPitchRoll_nc(mat); var ypr = x3dom_YawPitchRoll_nc(mat);
......
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