You are not logged in.

Dear visitor, welcome to 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.



  • "Zephyr" started this thread

Posts: 1,003

Location: Netherlands

Occupation: Web developer

  • Send private message


Sunday, November 12th 2017, 11:03pm

Determine viewable area/ bounding box

Hello all,

I like to calculate the min/max vlookat and hlookat of the area you are viewing (the bounding box). I like to determine which hotspots the users sees.

For example given a hfov and vfov of 90 (1:1 ratio), and a vlookat/hlookat of 0,0. I expect a bounding box of -45 45 45 -45 (West, South, East, North) So at first I thought it would be something like vlookat - vfov /2 and vlookat + vfov / 2 (same for hfov). But when you look down to 0, 90 you get coordinates like -45, 45, 45, 135 which isn't right because the panorama is spherical I'd expect -45 again. My math isn't great when it comes to sphericals ;p Can someone point me to the right direction? *confused*

Alexey Tkachenko


Posts: 760

Location: Sevastopol, Crimea, Russian Federation

Occupation: Interpreting, Building virtual tours

  • Send private message


Monday, November 13th 2017, 3:25pm


Not sure, but what if try to use screentosphere to determine sphere points corresponding to leftop, leftbottom, righttop and rightbotom points of the screen (thus, the bounding box in ath and atv coordinates).

E.g. something like this:

Source code

<action name="check_view_area" >		screentosphere(calc(stagewidth - stagewidth), calc(stageheight - stageheight), lefttop_h, lefttop_v);		screentosphere(calc(stagewidth - stagewidth), stageheight, leftbottom_h, leftbottom_v);		screentosphere(stagewidth, calc(stageheight - stageheight), righttop_h, righttop_v);		screentosphere(stagewidth, stageheight, rightbottom_h, rightbottom_v);				trace('lefttop point coodtinates == ', calc(lefttop_h + ' : ' + lefttop_v));		trace('leftbottom point coodtinates == ', calc(leftbottom_h + ' : ' + leftbottom_v));		trace('righttop point coodtinates == ', calc(righttop_h + ' : ' + righttop_v));		trace('rightbottom point coodtinates == ', calc(rightbottom_h + ' : ' + rightbottom_v));	</action>
Alexey Tkachenko has attached the following file:
  • test.xml (884 Byte - 7 times downloaded - latest: Apr 29th 2020, 1:42pm)