# 3x3/3x2 orthographic projection matrix

This topic is 668 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hey Volks

I have some trouble getting my 3x3 / 3x2 orthographic Matrix running from my 4x4 Matrix that looks like

2.0f * invRL           , 0                      , 0                      , 0
0                      , 2.0f * invTB           , 0                      , 0
0                      , 0                      , -2.0f * invFN          , 0
-(right + left) * invRL, -(top + bottom) * invTB, -(zFar + zNear) * invFN, 1


where

invRL = 1.0f / (right - left)
invTB = 1.0f / (top - bottom)
invFN = 1.0f / (zFar - zNear)


But I cant currently figure out (maybe related to the weather) how to make a 3x3 (and 3x2) Matrix from it looking same as the 4x4 one.

##### Share on other sites

Are you asking how to create a 3x3/3x2 matrix from an existing 4x4 matrix(or 4x4 orthographic matrix)?

If you are you normally make an orthographic or perspective matrix as a 4x4 Matrix. But if you really want to make a 3x3 matrix from a 4x4 matrix it isn't that difficult as you are just going to copy over the values of the of the X,Y, Z and ignore the W component values. However, if you want to convert a 4x4 orthographic matrix to a 3x3 matrix you're going to lose some data, in this case '-(right + left) * invRL, -(top + bottom) * invTB, -(zFar + zNear) * invFN'.

##### Share on other sites

how to make a 3x3 (and 3x2) Matrix from it looking same as the 4x4 one.

You can't.

How exactly is 3x3 matrix gonna transform 3d vectors, if it cannot add translation component to them by putting 1 into a 4d vector?

The translation component is :

-(right + left) * invRL, -(top + bottom) * invTB, -(zFar + zNear) * invFN, 1

and only 4d vectors with 1 as fourth component can have this base vector added, capish?

Now what you might be after though, is 4x2 matrix I gess?

With such a matrix you can transform 4d vectors into 2d vectors what I think is what you wish (the projected 2d, screen, etc)

Such a matrix should be simply the first 2 columns of your matrix in post as you layouted it.

1. 1
Rutin
24
2. 2
JoeJ
20
3. 3
4. 4
5. 5

• 9
• 46
• 41
• 23
• 13
• ### Forum Statistics

• Total Topics
631749
• Total Posts
3002047
×