-
Notifications
You must be signed in to change notification settings - Fork 687
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GizmoHelper doesn't respect camera up direction #522
Comments
GizmoHelper came in as a contribution, as such we'll need the community to resolve issues like this. Thank you for the report! |
This bug seems to have been introduced in pull request #496 (commit). I tried removing the |
I'm not an expert here by any means, but I was able to get GizmoHelper to have Z be up without touching the PerspectiveCamera You can change the global default up with THREE.Object3D.DefaultUp.set(0, 0, 1) and wrap it in a useEffect(() => {
THREE.Object3D.DefaultUp.set(0, 0, 1)
}, []) However, there's still something wrong with how the GLTF loads. I had to rotate it. But! GizmoHelper works as expected. See forked version of your sandbox: |
Setting camera direction z-axis up [0,0,1] is not getting applied to GizmoViewcube.
|
This seems to be sorta fixed if you have orbit controls with I think this should be a straightforwards fix though by just modifying animation block to check for the orbit "up", or alternatively it may be easier to just allow users to provide an UP prop direclty - it isn't really something that changes in applications where you want to use a gizmo cube (i.e. CAD type tools). |
versions
Problem description:
Setting the camera up position to something other than the default (e.g.
[0, 0, 1]
) works until the gizmo is used at which point it snaps back to the default up direction.Steps to reproduce
I hope that describes the problem, its pretty obvious one you try it. Here's a video (at the end you can see I drag the mouse horizontally but the orbit doesn't match)
Screen.Recording.2021-08-22.at.3.28.24.pm.mov
I had a very quick go at debugging but am really not sure what I'm doing, I could see in https://github.com/pmndrs/drei/blob/master/src/core/GizmoHelper.tsx the line
mainCamera.up.set(0, 1, 0).applyQuaternion(q1).normalize()
which I thought might be related but am not sure.
Having a lot of fun using r3f :)
The text was updated successfully, but these errors were encountered: