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
    Ilia Bg
    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
    kdv
    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

    Puzzles and JS coding. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.

    #53837
    Ilia Bg
    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
    kdv
    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…

    Puzzles and JS coding. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.

    #53845
    Ilia Bg
    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
    kdv
    Participant

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

    Puzzles and JS coding. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.

    #53978
    Ilia Bg
    Participant

    You right! Big thanks!

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