Beiträge von Nikkben

    Outputs: "Error. Unfortunately the page cannot be loaded". Mobile device is iphone 11/12. I tried cubemapsize="calc:min(4096,device.maxtexturesize)" , but it still gives an error.

    Is it possible to somehow prescribe in <image> a condition that if the computer version, it is cubemapsize=4096, and if the mobile version defaults to 2048 ?

    Hello everyone. I noticed that the jpg quality has become worse in the already assembled tour.

    The jpg source has a resolution of 10000*5000 and is much clearer and better than in the already assembled version. So I wondered how to keep the maximum quality from the source without greatly impairing performance. When building a tour, I use vtour-multires.config.

    As far as I understand, the value of tilesize plays a role in the quality of the image. In my tour tilesize=512. Here is an example of my scene:

    Thank you very much for your help, but now another problem has come out. I used to have a regular floorspot on the floor:

    And this floorspot correctly performed the floorspot_click() function (the nearest hotspot to the click location is calculated, and a move occurs to it) :

    Code
    <action name="calculatedistance" scope="local" args="x1, y1, x2, y2"> pow(a, calc(x2-x1), 2); pow(b, calc(y2-y1), 2); set(global.distance, calc(sqrt(a+b))); </action>
    <action name="getclosesthotspot" scope="local"> set(lowestdistance, 100000); set(global.closesthsname, ""); for(set(i,0), i LE hotspot.count, inc(i), calc(hs, hotspot[get(i)]); if (hs.clickablehotspot == true, set (x1, get(hs.tx)); set (y1, get(hs.tz)); set (x2, get(caller.tx)); set (y2, get(caller.tz)); calculatedistance(get(x1), get(y1), get(x2), get(y2)); if(global.distance LT lowestdistance, set(lowestdistance, get(global.distance)); set(global.closesthsname, get(hs.name)); ); ); ); </action>
    <action name="floorspot_click" scope="local">
        getclosesthotspot(); 
        calc(closesths, hotspot[get(global.closesthsname)]);
        tour_loadscene(get(closesths.linkedscene), null, MERGE|KEEPVIEW|KEEPMOVING, BLEND(1));
    </action>

    Here is an example of hotspots:

    Code
    <style name="hotspot" type="text"  width="100" height="100" scale="1"   mipmapping="true" zorder="1" distorted="true" depth="0" depthbuffer="true" torigin="world"  capture="false" handcursor="false"  clickablehotspot="true" keep="true"/>
    
    	<hotspot name="hotspot_001" style="hotspot" tx="-11820.78" ty="10.67" tz="8928.37" linkedscene="scene_M39_WT_001"/>
    	<hotspot name="hotspot_002" style="hotspot" tx="-9649.45" ty="-58.51" tz="8928.37" linkedscene="scene_M39_WT_002"/>
    	<hotspot name="hotspot_003" style="hotspot" tx="-7431.22" ty="-116.29" tz="8928.37" linkedscene="scene_M39_WT_003"/>

    But when I added to the project mouse_3d_cursor.xml (I deleted the old floorspot) and prescribed the same floorspot_click action for it, as you suggested above :

    Code
    function ondoubleclick()
    	{
    		krpano.call("floorspot_click");
    				
    	}

    With a double click, the logic of moving to the nearest hotspot from the click point disappeared somewhere, became incorrect. For example, it doesn't matter where you clicked, the movement always happens in one hotspot.
    This is how it looks completely mouse_3d_cursor.xml:

    I can't figure out what the problem is.

    Hello everyone, maybe someone knows how to call the normal krpano actions in javascript krpano actions.
    Here are the normal krpano actions:

    Code
    <action name="calculatedistance" scope="local" args="x1, y1, x2, y2"> pow(a, calc(x2-x1), 2); pow(b, calc(y2-y1), 2); set(global.distance, calc(sqrt(a+b))); </action>
    <action name="gotoclosesthotspot" scope="local"> getclosesthotspot(); calc(closesths, hotspot[get(global.closesthsname)]); tween(view.tx, get(closesths.tx)); tween(view.tz, get(closesths.tz));  </action>
    <action name="getclosesthotspot" scope="local"> set(lowestdistance, 100000); set(global.closesthsname, ""); for(set(i,0), i LE hotspot.count, inc(i), calc(hs, hotspot[get(i)]); if (hs.clickablehotspot == true, set (x1, get(hs.tx)); set (y1, get(hs.tz)); set (x2, get(caller.tx)); set (y2, get(caller.tz)); calculatedistance(get(x1), get(y1), get(x2), get(y2)); if(global.distance LT lowestdistance, set(lowestdistance, get(global.distance)); set(global.closesthsname, get(hs.name)); ); ); ); </action>
    <action name="mouse_3d_click" scope="local">
        getclosesthotspot(); 
        calc(closesths, hotspot[get(global.closesthsname)]);
        tour_loadscene(get(closesths.linkedscene), null, MERGE|KEEPVIEW|KEEPMOVING, BLEND(1));
    </action>

    I want to call action "mouse_3d_click" in the function ondoubleclick() of javascript krpano actions. Here is the action itself:

    onclick="change_backgroundurl('');

    here is my scene :


    <scene name="model" minpixelzoom="0" autoload="true" >
    <view hlookat="90" vlookat="0" fovtype="MFOV" fov="140.000" maxpixelzoom="1" minpixelzoom="0" fovmin="70" fovmax="140" limitview="lookat" vlookatmin="-90" vlookatmax="90" />
    <image prealign="-0.0|-0.0|-0.0" ox="0" oy="25" oz="0" >

    <depthmap id="depthmap" url="panos/untitled2.obj" backgroundurl="panos/vid_main_optim2.jpg" scale="100" hittest="true" waitforload="true" cull="front" subdiv="0" />

    </image>
    </scene>

    Thank you very much, when calling change_background url(") it gives an error : ERROR: change_backgroundurl - TypeError: Cannot read properties of undefined (reading 'setAttribute')

    Hi everybody
    My tour consists of one scene in which there is a 3d model . There are about thirty hotspots in this 3D model. The problem is that all these hotspots are visible at the same time, but I wanted the visibility of the hotspot to depend on the current position of the camera in the 3d model.
    For example, so that the hotspot is visible only at a distance of three meters from it, if the distance is greater, then it is not visible
    Or prescribe hotspots visibility only in certain planes of the 3d model. Do you have any ideas?
    Best regards, Nikolai

    Thank you so much, it helped me *thumbsup*