Commit 46163d47 authored by Oleg Dzhimiev's avatar Oleg Dzhimiev

added links for map - scene markers

parent 0757ceae
...@@ -270,11 +270,20 @@ function hll3_r_i(i,v){ ...@@ -270,11 +270,20 @@ function hll3_r_i(i,v){
var f1 = hll_f_3d_i(i,[v[0],v[1],heading]); var f1 = hll_f_3d_i(i,[v[0],v[1],heading]);
var f2 = hll_f_map_i(i,[v[0],v[1],heading]); var f2 = hll_f_map_i(i,[v[0],v[1],heading]);
console.log("f1 vs f2 == start");
console.log("1: "+f1+" vs "+f2);
f1 -= heading; f1 -= heading;
f2 -= heading; f2 -= heading;
console.log("2: "+f1+" vs "+f2);
f1 = bring_degrees_to_n180_180(f1); f1 = bring_degrees_to_n180_180(f1);
f2 = bring_degrees_to_n180_180(f2); f2 = bring_degrees_to_n180_180(f2);
console.log("3: "+f1+" vs "+f2);
console.log("f1 vs f2 == stop");
//return (f1-f2+360)%360; //return (f1-f2+360)%360;
return (f1-f2); return (f1-f2);
} }
......
var theLastMovedMarker = null;
function x3dom_delta_markers(){
// what's the last dragged marker? (over map?)
// see leaflet_init.js
var index = theLastMovedMarker;
var marker = Data.markers[index];
//console.log(marker.latitude+", "+marker.longitude);
var Camera = Map.marker;
var p_mark_ll = new L.LatLng(marker.latitude, marker.longitude);
var p_cam_ll = Camera._latlng;
var p_w = x3dom_delta_map2scene(p_cam_ll, p_mark_ll);
$("#deltasphere").remove();
$("#deltalink").remove();
var transl = [p_w.x,p_w.y,p_w.z].join(",");
var html = [
'<group id="deltasphere" class="deltasphere">',
' <switch whichChoice="0">',
' <transform translation="'+transl+'" >',
' <shape>',
' <appearance>',
' <material diffuseColor="green" transparency="0.5"></material>',
' </appearance>',
' <sphere radius="'+(x3dom_markersize()/2)+'"></sphere>',
' </shape>',
' </transform>',
' </switch>',
'</group>'
].join('\n');
var sphere_element = $(html);
$('scene',Scene.element).append(sphere_element);
//$(".my-markers").find("material").attr("transparency","0.5");
var coords = [
p_w.x+" "+p_w.y+" "+p_w.z,
marker.x+" "+marker.y+" "+marker.z,
].join(" ");
var html = [
'<group id="deltalink" class="deltalink">',
' <switch whichChoice="0">',
' <transform>',
' <shape>',
' <appearance>',
' <material emissiveColor="white" transparency="0.0"></material>',
' </appearance>',
' <lineset vertexCount="2" solid="true" ccw="true" lit="true">',
' <coordinate point="'+coords+'"></coordinate>',
' </lineset>',
' </shape>',
' </transform>',
' </switch>',
'</group>'
].join('\n');
var sphere_element = $(html);
$('scene',Scene.element).append(sphere_element);
}
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
<!---script type='text/javascript' src='js/x3dom/x3dom-full.debug.js'></script--> <!---script type='text/javascript' src='js/x3dom/x3dom-full.debug.js'></script-->
<script type='text/javascript' src='js/x3dom_init.js'></script> <script type='text/javascript' src='js/x3dom_init.js'></script>
<script type='text/javascript' src='js/x3dom_functions.js'></script> <script type='text/javascript' src='js/x3dom_functions.js'></script>
<script type='text/javascript' src='js/x3dom_deltas.js'></script>
<script type='text/javascript' src='js/leaflet_init.js'></script> <script type='text/javascript' src='js/leaflet_init.js'></script>
<script type='text/javascript' src='js/x3l.js'></script> <script type='text/javascript' src='js/x3l.js'></script>
...@@ -110,6 +111,7 @@ Instructions: ...@@ -110,6 +111,7 @@ Instructions:
5. To save the result click upload button (Camera initial position and orientation data) in the menu.' class='edit'></div> 5. To save the result click upload button (Camera initial position and orientation data) in the menu.' class='edit'></div>
<div id='align_button_heading' title='variable heading, fixed location' class='edit'></div> <div id='align_button_heading' title='variable heading, fixed location' class='edit'></div>
<div id='align_button_location' title='variable location, fixed heading' class='edit'></div> <div id='align_button_location' title='variable location, fixed heading' class='edit'></div>
<div id='markers_delta_button' title='link marker from model to marker from map (height==viewer height)' class='edit'></div>
<!--<div id='align_tr_button' title='Align tilt and roll' class='edit'></div>--> <!--<div id='align_tr_button' title='Align tilt and roll' class='edit'></div>-->
<div id='align_tr_button' title='Run least squares fitting algorithm (Gauss-Newton) for camera tilt, roll and altitude (relative). <div id='align_tr_button' title='Run least squares fitting algorithm (Gauss-Newton) for camera tilt, roll and altitude (relative).
Instructions: Instructions:
......
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