<p>Yep, that looks like a view matrix. A matrix can be stored in either <a href="https://en.wikipedia.org/wiki/Row-_and_column-major_order" rel="nofollow noreferrer">row- or column-major order</a>; that one appears to be column-major. As you’ve identified, the last row / column of it (the values you’ve marked as X, Y, and Z) are the camera position (followed by a 1, for <a href="https://en.wikipedia.org/wiki/Homogeneous_coordinates" rel="nofollow noreferrer">complicated reasons</a>); that would make the other three rows / columns the X, Y, and Z <a href="https://en.wikipedia.org/wiki/Basis_(linear_algebra)" rel="nofollow noreferrer">basis vectors</a> (at …<code>98</code>, <code>A8</code>, and <code>B8</code> respectively).</p>
<p>As Yves noted in the comments, getting a rotation out of those vectors is tricky. Fortunately, you may not have to: your head-tracking library should be able to give you a transform matrix containing the axes of the camera with the appropriate rotations applied. If you plug those values in to the appropriate places in your in-memory matrix (…and possibly spend some time swapping them around and/or negating them, to line up with whatever coordinate space your game uses), you should be good to go.</p>

CC BY-SA 4.0
2023-04-06T06:13:53.807Z
Thanks for the detailed answer. I agree that this is a difficult task and I will have to sit for many hours at the disassembler before I understand how to control the camera. But I'm ready for it.
F4rrell
CC BY-SA 4.0
2023-04-04T19:47:03.257Z
2023-04-04T19:47:03.257Z
Noah Witherspoon
<p>I want to control the camera in an old game using head tracking (TrackIR, opentrack, etc.), such control was not provided by the game engine. I'm trying to find the camera coordinates and rotation angles in memory so that I can recalculate them with my program. I haven't worked seriously with 3D until now. So far I have found some float array in memory and am trying to figure out how it works.</p>
<p>In the main menu of the game, when the map is not yet loaded, the values are:
<a href="https://i.sstatic.net/6z11L.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/6z11L.png" alt="enter image description here" /></a></p>
<p>In the loaded map, I have screened 3 states when looking parallel to the axes of the map. In a practical way, moving around the map, I found the coordinates X, Y, Z (Z - height)
<a href="https://i.sstatic.net/SzqpF.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/SzqpF.png" alt="enter image description here" /></a></p>
<p>Googling a bit, I think it's possible &quot;View matrix&quot; or &quot;Rotate matrix&quot;. I ask for help from those who understand 3D, did I determine correctly? Links to articles on how it works are welcome :)</p>

<3d><camera><camera-matrix>
Unknown array of floating point numbers. View matrix?
F4rrell
# Unknown array of floating point numbers. View matrix?

(Asked by: username_0 on 2023-04-04)

I want to control the camera in an old game using head tracking (TrackIR, opentrack, etc.), such control was not provided by the game engine. I'm trying to find the camera coordinates and rotation angles in memory so that I can recalculate them with my program. I haven't worked seriously with 3D until now. So far I have found some float array in memory and am trying to figure out how it works.

In the main menu of the game, when the map is not yet loaded, the values are:
[![enter image description here](https://i.sstatic.net/6z11L.png)](https://i.sstatic.net/6z11L.png)

In the loaded map, I have screened 3 states when looking parallel to the axes of the map. In a practical way, moving around the map, I found the coordinates X, Y, Z (Z - height)
[![enter image description here](https://i.sstatic.net/SzqpF.png)](https://i.sstatic.net/SzqpF.png)

Googling a bit, I think it's possible "View matrix" or "Rotate matrix". I ask for help from those who understand 3D, did I determine correctly? Links to articles on how it works are welcome :)

**Tags:** 3d, camera, camera-matrix


---

## 1 answers

### Answer by username_1 on 2023-04-04. Score: 1 | Accepted answer

Yep, that looks like a view matrix. A matrix can be stored in either [row- or column-major order](https://en.wikipedia.org/wiki/Row-_and_column-major_order); that one appears to be column-major. As you’ve identified, the last row / column of it (the values you’ve marked as X, Y, and Z) are the camera position (followed by a 1, for [complicated reasons](https://en.wikipedia.org/wiki/Homogeneous_coordinates)); that would make the other three rows / columns the X, Y, and Z [basis vectors](https://en.wikipedia.org/wiki/Basis_(linear_algebra)) (at …`98`, `A8`, and `B8` respectively).

As Yves noted in the comments, getting a rotation out of those vectors is tricky. Fortunately, you may not have to: your head-tracking library should be able to give you a transform matrix containing the axes of the camera with the appropriate rotations applied. If you plug those values in to the appropriate places in your in-memory matrix (…and possibly spend some time swapping them around and/or negating them, to line up with whatever coordinate space your game uses), you should be good to go.

> **Comments:**
> **username_0**: Thanks for the detailed answer. I agree that this is a difficult task and I will have to sit for many hours at the disassembler before I understand how to control the camera. But I'm ready for it.  

---

