http://www.highres.factum-arte.org/svf_lr/index.html
Sorry this has only the preview image, so as to show what I need to do but not to show the actual data that I cannot publish yet.
I am working on a painting and 3D viewer. The 3D is a rendering of 3D scanning of the surface at 100 microns resolution.
I have worked on my code to build a few tools, as a ruler that update an indication of dimension as one zoom in or out, or resize the window.
There is also a button on the ruler that places a grid on the image.
The grid is made of hotspots that are created one by one and their placement is updated in an onviewchange event that trigger the updategrid action I wrote.
In this example the grid is "only" 17 horizontal lines and 17 vertical ones so I just update them one by one.
Of course I feel that both the creation of the hotspots lines and their updating should be done in a loop instead of one by one.
Even more if I eventually want to add a 10mm grid as one zoom in.
How would I create the hotspots and update them using a loop?
The code is below
<hotspot name="grid_h_00" type="image" style="grid_lines"
ath="0.0" atv="0.0"
/>
<hotspot name="grid_v_00" type="image" style="grid_lines"
ath="0.0" atv="0.0"
rotate="90"
/>
<hotspot name="grid_h_01" type="image" style="grid_lines"
ath="0.0" atv="0.0"
/>
<hotspot name="grid_v_01" type="image" style="grid_lines"
ath="0.0" atv="0.0"
rotate="90"
/>
<hotspot name="grid_h_02" type="image" style="grid_lines"
ath="0.0" atv="0.0"
/>
<hotspot name="grid_v_02" type="image" style="grid_lines"
ath="0.0" atv="0.0"
rotate="90"
/>
...etc
<events name="ViewChangeActions"
keep="true"
onviewchange="updateGrid();"
/>
<action name="updateGrid">
<!--First place the central cross lines-->
set(hotspot[grid_h_00].width,100%);
set(hotspot[grid_v_00].width, 100%);
set(hotspot[grid_h_00].ath, get(view.hlookat));
set(hotspot[grid_v_00].atv, get(view.vlookat));
<!--Then calculate the grid space in fov value for the placement of the regular grid-->
<!--size of painting is 630.34x1560.75mm , 100mm grid is view.hfov and vfov divided by size multiplied by 100mm-->
set (h_fov_100mm, get(image.hfov));
set (v_fov_100mm, get(image.vfov));
div (h_fov_100mm, 6.3034);
div (v_fov_100mm, 15.6075);
<!--Place first the first 100mm offset cross lines-->
set(hotspot[grid_h_01].width,100%);
set(hotspot[grid_v_01].width,100%);
set(hotspot[grid_h_01].atv, get(v_fov_100mm));
set(hotspot[grid_v_01].ath, get(h_fov_100mm));
set(hotspot[grid_h_01].ath, get(view.hlookat));
set(hotspot[grid_v_01].atv, get(view.vlookat));
<!--Place then the second 100mm offset cross lines, the grid spacex2-->
mul (grid_h_x, h_fov_100mm, 2);
mul (grid_v_x, v_fov_100mm, 2);
set(hotspot[grid_h_02].width,100%);
set(hotspot[grid_v_02].width,100%);
set(hotspot[grid_h_02].atv, get(grid_v_x));
set(hotspot[grid_v_02].ath, get(grid_h_x));
set(hotspot[grid_h_02].ath, get(view.hlookat));
set(hotspot[grid_v_02].atv, get(view.vlookat));
...etc
/>
Display More