You are not logged in.

1

Wednesday, February 11th 2009, 6:19pm

Convert 2D Mouse Coordinates to atH and atV

Hi all,
I am trying to use the current hlookat, vlookat and fov to calculate where the user's mouse is in atH and atV angle coordinates. I am not too sure how to go about this. I have placed a sprite over the entire viewing region an am implementing a mouse move listener. When the user moves the mouse I would like to know what atH and atV coordinate they are at. I figured that hlookat and vlookat represent the middle of screen and that the fov is used somehow to calculate the max and min horizonatal and veritcal angle. Any pointers on how to go about this would be much appreciated.

2

Wednesday, February 11th 2009, 9:25pm

Hi,

there is the screentosphere() function for this:

http://krpano.com/docu/programming/#screentosphere

it converts screen or mouse coordinates to the pano h/v values,
this function can be used from AS3 or from Javascript,

(it is also used in the editor plugin when drawing hotspots)

best regards,
Klaus

3

Wednesday, February 11th 2009, 9:33pm

Thank a lot Klaus that is exactly what I need. *g*

Similar threads