# 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?

• Hi)

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:

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>``

Regards,

Alexey

## Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!