Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.
set(floorheight, 160); screentosphere(mouse.x,mouse.y, h,v); set(d,1); spheretospace(h,v,d, x,y,z); calc(hotspot[name].tx, x*floorheight/y); calc(hotspot[name].tz, z*floorheight/y); copy(hotspot[name].ty, floorheight);
Location: Netherlands
Occupation: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer
Location: Netherlands
Occupation: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer
I like the floor hotspot to point (rotate) to the ath position of the center of the/a polygonal hotspot.
Location: Netherlands
Occupation: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer
That's great.I'm looking forward to it.Not yet, but with one of the next releases.
This post has been edited 9 times, last edit by "indexofrefraction" (Dec 1st 2021, 11:35am)
![]() |
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
<krpano> <action name="place_floorspot_at_mouse_pos" scope="local"> set(d, 1); asyncloop(caller.loaded, screentosphere(mouse.x, mouse.y, h, v); spheretospace(h, v, d, x, y, z); calc(fh, caller.floorheight_cm - view.ty); calc(x, x * fh / y); calc(z, z * fh / y); set(caller, tx=calc(view.tx + x), tz=calc(view.tz + z), ty=calc(view.ty + fh) ); // optionally rotate the hotspot toward the target direction (e.g. for image-arrow-spots): // calc(caller.ry, atan2(x, z) * 180 / Math.PI); // optionally fade out the spot when too far away: // calc(distance, sqrt(x * x + z * z)); // calc(caller.alpha, distance LT 1000 ? 1.0 : 1.0 - (distance - 1000) / 100); ); </action> <preview type="grid()"/> <image oy="calc:hotspot[floorspot].floorheight_cm - 1000" /> <hotspot name="floorspot" devices="mouse" type="text" html="" css="font-size:80px;text-align:center;" vcenter="true" width="200" height="200" scale="0.2" bgalpha="0.5" bgroundedge="100" bgborder="2 0x000000 1" bgshadow="0 0 5 0xFFFFFF 1.0" oversampling="2" mipmapping="true" zorder="1" distorted="true" depth="0" depthbuffer="true" torigin="world" rotationorder="xyz" rx="-90" capture="false" handcursor="false" autoalpha="true" floorheight_cm="250" onloaded="place_floorspot_at_mouse_pos();" onclick="tween(view.tx, get(tx)); tween(view.tz, get(tz));"/> <style name="button" type="text" css="text-align:center;" padding="4 8" mergedalpha="false" bgborder="0 0xFFFFFF 1" bgroundedge="1" bgshadow="0 1 4 0x000000 1.0" ondown="set(bgcolor, 0xDDDDDD);" onup="set(bgcolor, 0xFFFFFF);" /> <layer name="dollhouse" style="button" html="Dollhouse" width="80" align="bottom" y="50" onclick="dollhouse_toggle();" /> <action name="dollhouse_toggle"> if(!control.invert, copy(hl, view.hlookat); copy(vl, view.vlookat); copy(fv, view.fov); lookto(270, 50, 90, default, true, true); tween(view.oz, 1200); set(control.invert, true); , lookto(get(hl), get(vl), get(fv), default, true, true); tween(view.oz, 0); set(control.invert, false); ); </action> </krpano> |
This post has been edited 3 times, last edit by "indexofrefraction" (Dec 10th 2021, 11:53am)
https://dearte.online/nav/Hi Klaus
Is it possible to override or limit the action of the floor hotspot
when approaching the edge of the panorama and thus prevent the
panorama from disappearing when the last wall is clicked?
and the panorama does not disappear?
Ramiro
I like the floor hotspot to point (rotate) to the ath position of the center of the/a polygonal hotspot.
Here a second example for such:
https://krpano.com/releases/1.20.10/view…t-example-2.xml
The example source:
https://krpano.com/viewsource.html?relea…t-example-2.xml