Skip to content
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> struggling with Z up camera #2074

Closed
RodrigoHamuy opened this issue Aug 28, 2024 · 1 comment
Closed

<GizmoHelper> struggling with Z up camera #2074

RodrigoHamuy opened this issue Aug 28, 2024 · 1 comment
Labels
bug Something isn't working released

Comments

@RodrigoHamuy
Copy link
Contributor

RodrigoHamuy commented Aug 28, 2024

  • three version: 0.167.1
  • @react-three/fiber version: 8.17.6
  • @react-three/drei version: 9.111.3
  • node version: 20.11.1
  • npm version: 10.2.4

Problem description:

If you use Z as the UP vector for the camera, and then try to rotate to face the Z axis, GizmoHelper will rotate correctly only the first time (video attached).

Relevant code:

import React, { useRef } from "react";
import ReactDOM from "react-dom";
import { Canvas } from "@react-three/fiber";
import { GizmoHelper, GizmoViewport, OrbitControls } from "@react-three/drei";

ReactDOM.render(
  <Canvas
    style={{ position: "absolute", inset: 0 }}
    camera={{ up: [0, 0, 1], position: [10, 10, 10] }}
  >
    <axesHelper />
    <OrbitControls makeDefault enableDamping={false} />
    <GizmoHelper>
      <GizmoViewport />
    </GizmoHelper>
  </Canvas>,
  document.getElementById("root")
);

Suggested solution:

Video:

gizmo-helper.webm
@RodrigoHamuy RodrigoHamuy added the bug Something isn't working label Aug 28, 2024
RodrigoHamuy added a commit to RodrigoHamuy/drei that referenced this issue Aug 28, 2024
Copy link

🎉 This issue has been resolved in version 9.111.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
None yet
Development

No branches or pull requests

1 participant