• Hi,
    I'm trying to lookto hotspot when clicked but not centered in the screen...
    Here is an exemple : http://360images.fr/barebonelookto/

    Works fine when hotspot has ath="0" but it doesn't when ath is different.
    Plus I would like to look to the offset position directly without having to look first at the centered position and then calculate the offset coordinates with screentosphere.

    Don't know if it's possible, well I guess it is with some math but I'm very bad with math...

    Any clue ?

    Here is my actual code :

    Code
    <style name="hsstyle" url="hs.png" onclick="lookto_offset(get(name))"/>
    	
    <action name="lookto_offset">
    lookto(get(hotspot[%1].ath), get(hotspot[%1].atv), get(hotspot[%1].tofov), smooth(50,50,50),true,true,
    calc(hpix,stagewidth * 0.25);calc(vpix,stageheight * 0.5);screentosphere(hpix, vpix, toh, tov);lookto(get(toh),get(tov),get(view.fov),smooth(50,50,50));
    );
    </action>
    	
    <hotspot name="hs1" style="hsstyle" ath="0" atv="0" tofov="20"/>
  • Hi)

    I tried calculating offsets, but it seems I'm lacking some deeper understanding of calculations between 3D space of the pano and screen plane.

    Code
    <action name="lookto_offset" >		showlog();		calc(hpix,stagewidth * 0.25);		calc(vpix,stageheight * 0.5);		spheretoscreen(hotspot[%1].ath,hotspot[%1].atv, x,y);		screentosphere(hpix, vpix, toh, tov);				set(screen_distance, calc((3 * hpix) - x));		trace('screen_distance == ' , screen_distance);				set(spherical_distance, calc(hotspot[%1].ath - toh));		trace('sp dist == ' , spherical_distance);				set(fov_difference, calc(hotspot[%1].tofov / view.fov));		trace('fov diff == ' , fov_difference);				set(target, calc(hotspot[%1].ath - (spherical_distance * fov_difference)));		trace(target);		lookto(calc(hotspot[%1].ath - (spherical_distance * fov_difference)), calc(hotspot[%1].atv), get(hotspot[%1].tofov), smooth(50,50,50),true,true);	</action>


    Obviously, the current FOV and target FOV of the hotspot must be taken into consideration.

  • Another approach would be (with fovtype="hfov") :

    Code
    <action name="lookto_offset">
    lookto(calc(hotspot[%1].ath - (hotspot[%1].tofov / 4)),get(hotspot[%1].atv),get(hotspot[%1].tofov),smooth(50,50,50));
    </action>


    but it's still not precise...

Jetzt mitmachen!

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