We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

Problem with “on event of wheel” puzzle

Home Forums Programming Problem with “on event of wheel” puzzle

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #53831
    ilyabogomolov
    Participant

    I put it into this section of forum because i believe it requires programming understanding, so i think i will find and answer there faster

    Hi all, i’m trying to recreate this code example

    I believe that i did almost understand the behavior itself, now i just look for a way to add it to the existing web app of mine. Right now i faced a problem – i am trying to use html puzzle “on event of wheel” for elem – there i used different options in “for elem” field, such as HTML DOM Object puzzle with all the options – container, window, document, body, or simply put “v3d-container”, both times i tried it with “in parent” checked and without it, but it works only for “My_Custom_UI.html” elements (shown in the attached screen) not for the embeded via <iframe> tag web app itself, there i mean “canvas.v3d-canvas” element, this name i’ve got from inspecting html elements via console inspector

    I will later use this “on event of wheel” puzzle to change FOV of the camera, thus enabling zoom into the panorama.

    Attachments:
    You must be logged in to view attached files.
    #53834
    kdv77kdv
    Participant

    disable zooming to free “wheel” event listener
    app.controls.enableZoom = false;

    by default this event listener is busy

    in fact, nearly all event listeners are already assinged and busy, but this “wheel” event performs only zooming, not allowing to do something else. for example, it doesn’t allow to scroll pages when the cursor is over v3d-container

    #53837
    ilyabogomolov
    Participant

    Thank you very much man, your tip helped!
    This piece of code works! Finally i made a little step forward in my attempt.

    One more question, is there a way to declade variable globaly, so i don’t need to write it in every “exec script” puzzle?

    Attachments:
    You must be logged in to view attached files.
    #53843
    kdv77kdv
    Participant

    is there a way to declade variable globaly

    what variable do you mean? enableZoom? You can declare it once in the runCode(app) function…

    #53845
    ilyabogomolov
    Participant

    I mean “var camera = app.scene.getObjectByName(‘CamMain’);
    If i don’t do this, then i always get error “camera is not defined” and it works this way with all variables

    #53846
    kdv77kdv
    Participant

    why do you create var camera? Can’t you use app.camera?

    #53978
    ilyabogomolov
    Participant

    You right! Big thanks!

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.