- Home /

Is there a way to convert the editor camera coordinates to game camera coordinates?

In the this answer I noted you can find the current project's editor camera cooordinates in the [project].xkpkg.user file. When I copy them to an in-game camera however I don't get the expected values.

They look like this:

```
CamPosition: {X: 59.2712555, Y: 31.0126514, Z: -59.5788536}
CamPitchYaw: {X: -0.5987319, Y: 2.36465549}
CamProjection: Perspective
CamVerticalFieldOfView: 45.0
CamOrthographicSize: 10.0
CamNearClipPlane: 0.1
CamFarClipPlane: 1000.0
CamAspectRatio: 1.77777779
CamMoveSpeed: 3.0
```

Comment

Best Answer

**Answer** by Kryptos
·
Aug 25 at 02:20 PM

The camera position is in the same unit. So you can copy it to the transform position of your camera (assuming that camera is a root entity, otherwise you will have to take into account its ancestor position offset).

```
CamPosition: {X: 59.2712555, Y: 31.0126514, Z: -59.5788536}
Position: {X: 59.271, Y: 31.013, Z: -59.579}
```

The rotation on the other hand is saved as pitch (X) and yaw (Y) angles in radians. So you need to convert it into degrees (360 degrees = 2*Pi rad) before inputting them in the rotation property of the editor.

```
CamPitchYaw: {X: -0.5987319, Y: 2.36465549}
Rotation: {X: -34.305, Y: 135.485, Z: 0}
```

boriscallens

Back to xenko.com