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.

On click vs navigating

Home Forums General Questions On click vs navigating

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
  • #27693


    Our project requires that most objects are clickable.
    Now we´re running into the following problem:
    If you try to navigate the model you might start your click&drag over an clickable object. As soon as you click the “when clicked” event will be executed.

    How it should work:
    While hovering over an clickable object:
    -On mouse down nothing should happen.
    -If you drag the mouse you can navigate the scene as expected (like clicking outside the object)
    -If you release the mouse without dragging the “click” event will be execute.

    Another issue:
    The “when clicked” event is executed even on middle and right mouse button.
    Any way to prevent this?

    Thanks and br


    I found this thread with the same issue from last year:

    Clicking vs Dragging

    The solution seems kinda complicated.
    Are there any new developments since this thread which will make it easier to differentiate between click and drag?

    • This reply was modified 1 year, 4 months ago by zeitgeist.

    I got the same issue as you described, and I already responded to the thread you linked.

    I also tried the solution mentioned in the thread. It works, but sadly it seems to drop the performance quiet heavily for my application, so I deactivated it.
    But I’m confident that the Verge Team will implement such a function in the near future.


    Not finished yet, but here is my first version:

    You must be logged in to view attached files.


    Running into the same issue here. It looks like the solution posted by zeitgeist will work – but I would like to suggest this would be a good thing to add into the verge3D user interface. Other programs I have used (such as Tumult hype) can differentiate between a drag and a click without having to build custom code.

    Regardless, thanks @zeitgeist for posting your solution


    There are several options to determine if a click is intended to be a click on an object or a click for a camera drag. The options are even greater if you play with the number of potential layers for navigation. (V3D Scene level, vs HTML document level).

    One way is to set a variable when you click/hover on an object. You can assign the variable a length of time to be true and while true an If loop in your on drag events will not work.

    Alternatively, you can monitor mouse movement. On a purposeful click the order of logic is hover, then click, then mouse stays within the object. If those three conditions are satisfied, then click object else allow drag.

    There is also the ability to time how long the mouse is over and within an object so as to determine intent and if said time reaches a threshold, allow the click to work, else drag.

    There are many solutions some that will work better than others that require a little more effort. Some can consume cycles and eat up performance, but there are lots of choices.

    The nice thing is Verge allows us to create/program and develop the code that is best for our needs without having the bloat of too many pre-packaged solutions.

    As we create more and more complicated scenes with HTML/CSS overlays and V3D scenes, and other third party software the screen space gets cluttered with clickable things on two or more layers. We as developers need to keep in mind good UI/UX as well and not make things difficult to navigate.

    On the off chance, a scene consists of 1000s of clickable objects and the clickable space far exceeds the empty space to drag…I think a different method of navigation would be more appropriate.

    Route 66 Digital
    Interactive Solutions

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