You are not logged in.

hfeist

Beginner

  • "hfeist" started this thread

Posts: 10

Location: Toronto

Occupation: artist

  • Send private message

1

Friday, May 8th 2015, 11:36pm

create hotspot where user clicked?

I'm working on a project where users are asked to click on an HTML5 panorama of a room interior and leave there comments.

i know how to capture mouse.x and mouse.y coordinates where they have clicked and save those to an array to be stored in a database. and i can generate a new xml file from the database contents the next time the panorama is accessed so users can see all the comments so far. however I cannot see a way to create hotspots from those coordinates since the hotspot parameters ask for ath and atv. is there a way to convert x/y to ath/atv?

it would also be nice if i could create a hotspot immediately where they have clicked so they can see where they've commented already as they proceed through their session.

any suggestions?

panomaster

Intermediate

Posts: 297

Location: Kobyłka, Poland

Occupation: Virtual Tours - Spherical Panoramas - Krpano developer

  • Send private message

3

Monday, May 11th 2015, 2:33pm

Hi,

here a super simple example:

Source code

1
2
3
4
5
6
7
8
9
10
<events onclick="test();" />

<action name="test">
  screentosphere(mouse.x, mouse.y, h, v);
  txtadd(hs, 'hs_', get(hotspot.count));
  addhotspot(get(hs));
  set(hotspot[get(hs)].url, 'hotspot.png');
  copy(hotspot[get(hs)].ath, h);
  copy(hotspot[get(hs)].atv, v;
</action>


Best regards,
Klaus