Skip to content

Commit

Permalink
set camera to 5, 5, 5
Browse files Browse the repository at this point in the history
  • Loading branch information
PythonFZ committed Dec 9, 2024
1 parent 7c629e9 commit a8d020c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export default function App() {
const [roomName, setRoomName] = useState<string>("");
const [geometries, setGeometries] = useState<any>([]);
const [cameraAndControls, setCameraAndControls] = useState<any>({
camera: new THREE.Vector3(0, 0, 0),
camera: new THREE.Vector3(5, 5, 5),
target: new THREE.Vector3(0, 0, 0),
});
// TODO: initial values are wrong for orbitcontrolstarget and camperaPosition
Expand Down
3 changes: 2 additions & 1 deletion app/src/components/cameraAndControls.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import * as THREE from "three";
import { getCentroid, useCentroid } from "./particlesEditor";

const zeroVector = new THREE.Vector3(0, 0, 0);
const initialCameraVector = new THREE.Vector3(5, 5, 5);
const upVector = new THREE.Vector3(0, 1, 0);

const MoveCameraTarget = forwardRef(
Expand Down Expand Up @@ -164,7 +165,7 @@ const CameraAndControls: React.FC<CameraAndControlsProps> = ({
// if the camera positions and target positions is default, adapt them to the scene
useEffect(() => {
if (
cameraAndControls.camera.equals(zeroVector) &&
cameraAndControls.camera.equals(initialCameraVector) &&
cameraAndControls.target.equals(zeroVector)
) {
const resetCamera = getResetCamera();
Expand Down
2 changes: 1 addition & 1 deletion tests/test_camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ def test_camera(server, s22):
vis = ZnDraw(url=server, token="test_token")
vis.extend(s22)

assert vis.camera["position"] == [0, 0, 0]
assert vis.camera["position"] == [5, 5, 5]
assert vis.camera["target"] == [0, 0, 0]
assert len(vis.camera) == 2

Expand Down

0 comments on commit a8d020c

Please sign in to comment.