lookto 3d hotspot

  • Hello,

    I have a question, sorry if it was asked already.
    i am using looktohotspot() to look the clicked hotspot.

    But now my all hotspots' ath=0 and atv =0. Stilll their positions are different from each other cuz I am using ox,oy and ty.
    in this case, looktohotspot() is looking to the same point (0,0).

    is there any way to lookto moved/translated hotspot?

    Thank you

    Edited once, last by Mudin (May 18, 2016 at 7:53 AM).

  • Hi,
    I am using hotspot for showing floor plan and markers. (see the image below)

    My source code is here:

    in js :

    How can I find the fake ath, atv for each marker hotspots which are moved by using ox, oy, ty?

    I hope this will be good for showing floor plan in the scene, even in vr mode.
    Kindly help me for this.
    Thanks,
    Mudin

  • I think I have an idea what you are doing, but I'm not sure why you are taking this approach..Anyway.


    I think converting is possible, but why don't you make it easier on yourself and simply focus on the mouse coordinates when you clicked something? You can translaste the mouse X and Y to ATH and ATV and move to that position with something like.

    Code
    screentosphere(mouse.x, mouse.y, new_ath, new_atv);
    lookto(ath,atv,30, smooth(50,50,50));
  • Thank you for your reply,

    Yeah you are right!
    But the reason why I chose this approach is ..
    Even we click the floor plan, it should 'lookto' nearest hotspot of the clicked position and open its scene.

    I need to convert mouse(ath,atv) to floor plan(ox,oy),
    Then I can find the nearest marker and convert its (ox,oy) to (ath,atv).
    And I can lookto to this (ath,atv) before open it.

    If you have better idea, I will appreciate it.

    Thanks

    Mudin

    Edited once, last by Mudin (May 21, 2016 at 1:35 PM).

  • So let me get this straight...

    When you click anywhere on the
    floor plan, you want to invoke an action that cycles through all the
    hotspots to find the nearest one and center on that one?

    I'll have to think a bit how that could be make elegantly.

    Do you perhaps have a link to a demo?

  • Hello,

    Yes you are right, that's what I am trying to do!

    And also floor plan enable is false, it doesnt call 'onclick'.

    Quote


    <style name="floor_plan_style" distorted="true" enabled="false" zorder="1" width="512" height="512" alpha="0.7"/>
    <hotspot name="fp_1" style="floor_plan_style" ath="0" atv="0" url="floor_plan.jpg" onclick="js(pvrPlayer.fire('f_click'))"/>

    If it is 'true', it calls the js, and I may know that the floor_plan is clicked even in vr mode.
    But in this case, since it is big hotspot, it doesnt let me change view, i always have to use out of it for moving.
    This is one more issue I got now *smile* .

    And Sorry, currently I don't have online demo link.

    Thank you very much for your help.

    Mudin

Participate now!

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