<p>My world has the base unit of 1024. Each tile is 1024x1024 units.
When the camera is at the center of a tile, the tile ranges from -512 to 512 in view space (no rotation).</p>
<p>Does it make sense (and is it even possible) to compose a view matrix that &quot;scales&quot; the unit in such a way that [0,1024] maps to [0,1]?
If the Camera is at the center of a tile, the tile should range from -0.5 to 0.5 in view space.</p>
<p>I would prefer to not scale the world matrices of objects.</p>

CC BY-SA 4.0
2023-07-25T13:26:46.447Z
Are you using a projection matrix as well? Usually this is the point where you can scale how much the camera shoud see... You can also scale the view matrix but in general the view matrix only stores the position and orientation of your camera
Thomas
CC BY-SA 4.0
2023-07-25T13:42:23.890Z
Yes, but I am computing stuff in view space and having small numbers makes the whole thing easier to grasp and debug to be honest.
Raildex
CC BY-SA 4.0
2023-07-25T15:41:45.670Z
You can apply a scale matrix after the view matrix. **3D:** $\begin{pmatrix}
Scale_x& 0 & 0 & 0\\
0 & Scale_y& 0 & 0\\
0 & 0 & Scale_z& 0\\
0 & 0 & 0 & 1
\end{pmatrix}$
**2D:**
$\begin{pmatrix}
Scale_x& 0 & 0\\
0 & Scale_y& 0\\
0 & 0 & 1
\end{pmatrix}$
Thomas
<camera-matrix>
Is it possible to scale a view matrix?
Raildex
# Is it possible to scale a view matrix?

(Asked by: username_0 on 2023-07-25)

My world has the base unit of 1024. Each tile is 1024x1024 units.
When the camera is at the center of a tile, the tile ranges from -512 to 512 in view space (no rotation).

Does it make sense (and is it even possible) to compose a view matrix that "scales" the unit in such a way that [0,1024] maps to [0,1]?
If the Camera is at the center of a tile, the tile should range from -0.5 to 0.5 in view space.

I would prefer to not scale the world matrices of objects.

**Tags:** camera-matrix

> **Comments:**
> **username_1**: Are you using a projection matrix as well? Usually this is the point where you can scale how much the camera shoud see... You can also scale the view matrix but in general the view matrix only stores the position and orientation of your camera  
> **username_0**: Yes, but I am computing stuff in view space and having small numbers makes the whole thing easier to grasp and debug to be honest.  
> **username_1**: You can apply a scale matrix after the view matrix. **3D:** $\begin{pmatrix} Scale_x& 0 & 0 & 0\\ 0 & Scale_y& 0 & 0\\ 0 & 0 & Scale_z& 0\\ 0 & 0 & 0 & 1 \end{pmatrix}$ **2D:** $\begin{pmatrix} Scale_x& 0 & 0\\ 0 & Scale_y& 0\\ 0 & 0 & 1 \end{pmatrix}$  

---

## 0 answers

