dynamically set VR Thumbs with "showthumbs" from krpano_vr.xml

  • Hi,

    I got the VR thumbs menu from this example https://krpano.com/releases/1.20.…tml5=only+webgl
    showing up at the origin of my depthmap panos when pressing the HOME button in VR. The code below will show the thumbs menu at origin, also when I'm in a pano with offset.
    Now I struggle calculating the current offset and adjust it dynamically in the showthumbs action, before the thumbs get tweened from ty=10000 to ty=0 with ox|oy offset, whereever the cameraposition is at the moment.

    Could someone give me a push in the right direction at which position to maybe copy the current location coords and use them to show the thumbs correctly? I tried tracing various coords without success.

    Thanks,
    loki

  • Hi jerome and thanks for the hint.

    I added

    Code
    tx=calc(view.tx),
    tz=calc(view.tz),

    to the add_example_thumb action and partly succeeded: Now the vr thumb menu pops up at the correct tx, ty, tz, but always faces towards hlookat 0.

    I was wondering if I could dynamically calculate the fixed ath and yoffset values (eg. -27 and --60) in the action below but also no success, probably because scopes and args is still new to me?

    Code
    <action name="add_examples" scope="local" autorun="onstart">
    		def(global.thumbs, array);
    		add_example_thumb('Monoscopic 2D Panos',   -27, -60,'%CURRENTXML%/thumb_corfu.jpg',     load_example('corfu.xml'); );
    		add_example_thumb('Stereoscopic 3D Panos',   0, -60, '%CURRENTXML%/thumb_pano3d.jpg',    load_example('bluebonnet/tour.xml'); );
    		add_example_thumb('Stereoscopic 3D Panos', +27, -60, '%CURRENTXML%/thumb_tour3d.jpg',    load_example('stereoscopic.xml'); );
    		add_example_thumb('Stereoscopic 3D Panos', -27,+290, '%CURRENTXML%/thumb_temple3d.jpg',  load_indiantemple_example(); );
    		add_example_thumb('Depthmap 3D Tour',        0,+290, '%CURRENTXML%/thumb_depthmap.jpg',  load_depthmap_example(); );
    		add_example_thumb('Panoramic Video',       +27,+290, '%CURRENTXML%/thumb_panovideo.jpg', load_videopano_example(); );
    	</action>

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!