compass example for landscape panos

  • Hi everybody!

    Tuur asked me for the compass in this thread.<-- you can see the working compass there.

    So i want to share this code to you - maybe you will use it or have ideas to optimize and perform this thing (it is not perfect, but works fine for its reason...).

    MANY(!!) thanks to Klaus - for his really cool product and for answering a lot(!) of questions i asked during the development of my project (see thread above) the last couple of month.
    !! THANK YOU !!

    Here is my compass (of course you have to make your own graphics...):
    ... is a little bit tricky:

    1) there is a pane "cPane" that holds all components and it is their parent of course
    2) the white compass shade (behind the letters) "compassRing" is nonrotating but needs to be masked out (mask="compassMask")
    3) the letters itself (rotating with viewchange) need to be masked too
    (mask="compassMask1"); it is the same mask as above but one plugin used
    for masking only can mask ONE other plugin so you have to gen a 2nd
    plugin with the same url to mask sth else with the same graf mask...
    4) to "north" the view i made an action name="norden"; it is not
    optimized (even bugy) - because if you turn around twice the pano and
    the click to "north" it also turns back twice(!) - i know this could be
    solved using the "mod(..)"-function, but time...
    5) to get the compass follow the view you of course have to define a ´
    onviewchange="viewchange()" ´ somewhere in your events-node and then
    have a corresponding action as "viewchange" below. Not all the tours in
    this project do have a compass but they do use the same code modules,
    so i asked for existance of the compass within this action...
    6) last but NOT LEAST i had to initiate the compass (set the
    initrotate of the plugin compass) with an action that fires for every
    scene-load, corresponding to its view and the distance (degrees) to the
    north; therefore (for 115 panos this was work too) i had to measure
    this distance and store it somewhere...

    Hope it helps!


  • that compass kicks much ass! thanks for sharing!

    edit: went to give this a try. realized there were no graphics. came here to look and found that you are not willing to share the graphics to make it work. understandable but disappointing.

    Einmal editiert, zuletzt von VN2009 (11. Februar 2010 um 02:08)

Jetzt mitmachen!

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