question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

A question, why use ownerDocument in OrbitControls, but DragControls not?

See original GitHub issue

Hi, I use both OrbitControls and DragControls in my Scenario Editor Project. When I drag the target mesh out of the Canvas, the Canvas will make a large rotation due to the mousemove event binded to the ownerDocument by OribitControls. My solution is to overwrite the activate & deactivate function with ownerDocument in DragControls. Or the same to overwrite the Orbitontrols event function without ownerDocument.

DragConrtols L21 ~ L45, without ownerDocument https://github.com/mrdoob/three.js/blob/696d7836d1fc56c4702a475e6991c4adef7357f4/examples/js/controls/DragControls.js#L21

OrbitControls L914 ~ L921, with ownerDocument https://github.com/mrdoob/three.js/blob/696d7836d1fc56c4702a475e6991c4adef7357f4/examples/js/controls/OrbitControls.js#L914

Using ownerDocument will expand the scope of the mouse event. Is there any special purpose?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
mrdoobcommented, Sep 1, 2020

When changing the camera view by dragging the viewport in https://threejs.org/editor/, I found it frustrating that the view would stop changing because I hit the end of the viewport.

Most common 3d software behaves like that I think. In fact, I remember some 3d software would even wrap the cursor around the screen 😁

Read more comments on GitHub >

github_iconTop Results From Across the Web

Suggested fix for OrbitControls pop-up window support · Issue ...
Issue: Use in a popup window causes the orbit controls to fail because they ... A question, why use ownerDocument in OrbitControls, but...
Read more >
Can't I use DragControl and OrbitControl at the same time?
but when I tried to do so, dragStart callback function is not called. it's because I'm touching overlay. is there a any way...
Read more >
Drag an object in combination with OrbitControls
EDIT: I've decided to not use DragControls or TransformControls as both are not doing what I require them to do. For now I've...
Read more >
Add Controls in ThreeJs | OrbitControls in ThreeJs - YouTube
Controlling objects in ThreeJs is a pretty important topic so by doing that we can create a pretty good interactive 3D view, we...
Read more >
Point Drag Controls for Three.js - virtual.blue
Drag controller for Three.js allowing translation and rotation of individual objects around the clicked point. Supports touch. Works with OrbitControls.js.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found