How to dynamically add hotspots to a scene based on location and heading

  • Hi there,

    I'm trying to figure out how I could add hotspots programatically. Same concept as 360cities where there are hotspots pointing to the nearest places with other 360 photos. this is dynamic I dont think somebody edits all the xml each time a person uploads a new panorama.

    Anyway, anybody here know how I could do that? There are code to determine nearby locations based on latitude and longitude but I don't know how I will determine where the hotspot will be placed inside the scene. I can list all the nearby locations place them as hotspots but I don't know how I will determine where to place them within the scene. I know this will depend on the heading of the current scene and heading of the nearby place with 360 but right now I don't how to do that.

    Any ideas?

  • Im answerng my own question here

    http://www.ig.utexas.edu/outreach/googleearth/latlong.html

    Turns out there is a formula. You will be able to get the heading if you have lat long of 2 points. Assumption is the base scene 's heading is north. So there will always be a manual part of determining where north is and making that the 0 heading of your panorama.

  • yes, I'm using geodetic calculations for the automatic placement of hotspots on panoramas
    Unfortunately, my client, for which I am doing Virtual Tours, asks to leave this method a secret from their competitors
    so I do not to publish it yet
    Here is an example of this method http://3dpano.by/geo/

  • Same idea I had and went in coding the algorithms. Spent looooot of hours on the topic and finally got it working. As I have 100+ panoramas the math took to long to be fully dynamic so went in partial solution direction.
    As i decided to show only 4 closest point to actual one, one for each quadrant I had to separate all point in corresponding quadrants based on actual point, calculate all distances, sort them...all on the fly. As it took significant time to recalculate I had two options: to use js for math (not so good with) or to make offline calculation for all points and use them dynamically. Did the second solution.
    At the end it worked like a charm, with hotspot style that pops up the thumb, name and distance. Very nice, but...
    Than I realized than for all panoramas I have to make new spheres with correct offset and rebuild the panos. There also had to make calculator for offset in px based on where and how much the sphere had to be adjusted. There I stoped. Concept proved and working offline. When new pano is added I have to run my side code to recalculate all distances and use this result as data stored in one separate xml that is used dynamicly when loading pano to display 4 neareast hotspots. Still have to finalize the solution completely (not covered side cases when quadrant has no hotspot) but this will take not more than couple of additional hours. Stoped there for now.
    Planed to make this live in second version of my town panorama portal done by my team so can't share the code but will give you hints if needed.
    In general if you have not so many points you can display hotspots for all of them fully dynamic. If you want to display just closest per quadrant than it is much complicated. Unfortunately I like such a ideas how ever they complicated are.

  • 2 Umalo

    all done much easier
    in each scene are given latitude, longitude and elevation of the point above the local level of the Earth's surface
    to accommodate the hotspot in the panorama works action : calculating the azimuth (ath) , the distance and the height of the camera - used to calculate the angle where must be placed hotspot in the vertical plane (atv)
    all fully automatically for any numbers of hotspots (scenes)
    for precise orientation of the panoramas to the north , you can use image.prealign (0|XX|0), but for use under html5 - need to rotate the image

    very sorry that I can not yet publish the algorithm


    Serge

  • 2 Taurus
    Adding hotspot (hardcoded) manualy in each scene (like in your example) and than calculating the bearing and distance for them is not the topic here.

    We are talking on how to add hotspots dynamically in case you have many points (how ever organized: via scene lat lon or via e.g. bing spots as I have) not to code for each scene what hotstpot to place and than caclulate where to place them on the screen but to have system that will do that automatically for e.g. 4 closest points. And in case you add new points in your tour not to hardcode/change and adapt the hotposts per scenes.
    My solution was complicated as I decided to separate all spots in quardrants and than calculate closest one per each quadrant. If I decided to have only 4 closest than is would be much easier.
    Formulas for bearing and distance are well known: see http://www.movable-type.co.uk/scripts/latlong.html

    If you want HTML5 solution than you must offset the sphere image. If there are other solution I would also like to hear.

  • 2 Umalo

    or I do not understand you, or you did not understand me
    My algorithm can do whatever you want

    Here is an example of arrangement of hotspots http://3dpano.by/geo_dynamic/
    in this example all panoramas are separate XML without hotspots
    hotspots are placed outside the panoramas
    Information about nearby panoramas defined in a separate xml

  • You have 5 near points defined in xml and based on that you are dynamically placing hotspots. Don't find my words wrong, but your solution is using hard coded lat and lng for each hotspot to be displayed. I don't call this dynamic.
    Your code to calculate position based on that we can call dynamic hotspot placement so your solution is fine and hitting the thread topic exactly. This is valid for second code provided. In first you had even hardcoded action in each scene to display hotspots which is completely out of this topic.

    I was talking on fully dynamic solution that is choosing what hotspots to place on the pano based on where you are and "this and that" (I choose per quadrant closest point). Solution that is working without touching the code and redefining the nearest points in the code when you add new point. Imagine you add 100 point to your demo work. Would you like to display all 105 hotspot in each panorama. Probably not. Than you will ask your self what to display. Most probably you will go in direction of making code to find 5 closest one and than display them. Than you will ask your self why to display this 5 when 4 of them are so close and overlapping...and at the end you will end up on my solution. Get it?
    I wanted solution that I just have to add how many panoramas I want and not to think if some of new panoramas are now becoming closest one to this and that point. Hope you get what I'm talking about. If not I propose to continue discussion per mail as it goes a little bit out of the topic.

    regards
    Umalo

  • respected Umalo,

    instead of having to re-read the first message from topikstarter, you say strange things
    I think that more than a hundred of our colleagues who have viewed this topic, already laughing at us *unsure*

    task to dynamically bind like-360citie hotspot separate XML-files are not standing in front of me, the algorithm I use only within the virtual tour with the scenes, however, is not just for placing spots
    obviously, its capabilities are much broader
    first and then the second sample were made specifically to demonstrate the applicability of the transformation of geodetic coordinates into spherical, for automatic placement of spots in the panorama
    to write code to sort and select N nearest objects to the current location will be able to even middle school student
    and to make that the arrows are not creeps friend-on-friend

    there is a saying: Every sandpiper praises its swamp
    I'm not going to prove to you, your right - to continue to work the way you feel right

    propose to cease our holivar
    If you have questions - please use the e-mail

    best regards
    Serge

  • hi, finally i can answer to something instead of always asking
    i have geo-reference for all my pano and i have a table from n->m (almost equal to n^2 records)
    since i use only the nearest 10 i delete all the other records so the sable wond be full of something i dont use
    the table has place 1, place2, bearing and distance... i mean place because sometimes i have pano from exactly the same place
    everytime i add a new pano i add 10 recs to that table
    i have a "north correction" in all my panos
    i place sume "blue arrows" in the pano horizon in the correct heading to the other pano place
    seems like you want to do this.
    the formulas i use were taken from here

    http://www.movable-type.co.uk/scripts/latlong.html


    hope it helps

    Rui Pedro
    http://www.panoramapalace.com

  • Hi!

    I'm working with different 3D software and are interested in doing some tests using 3d generated panoramas and add it to a custom streetview. Could be for architectual walktroughs or similar. I am going to generate panoramas and add geotags with north direction from the 3D software.

    I'm looking for something similar like this:
    http://www.diy-streetview.com/krpano-player-database-leaflet/

    Since you are discussing this, are anyone of you planning to release a plugin for this?

    Autoadd hotspots based on nearby panoramas (The autoadd function could be precalculated before panoramas are published)
    Keep current orientation when switching to a new panorama (just like google streetview)
    Clickable arrows like in google streetview

    Best Regards,

    Kristian

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!