Hi!
i've got a problem with matrix multiplication i hope you can help me...
i want to multiply my projectionmatrix with another matrix, so that the renderoutput always stretches with the windowsize! means that a square object, that fills out the whole window when the window has the same hight and width, then the object shall get stretched when i resize the viewport so that it always fills out the whole window (all objects shall be stretched that way) . . .
to achieve that i think i have to multiply the projectionmatrix with another matrix which is somehow dependant from screenhight/screenwidth . . .
can someone help me with that? thx!
projection matrix multiplication help
I think that the window size in pixels does not change the projection of geometry.
I mean, if you create a quad that fills the whole screen, you can change the resolution as you like, and it will still fill the whole screen anyway, if you don't change the FOV and the aspect ratio.
I am not sure about that, but you should test it.
If I want to create a screen-aligned quad I set position and rotation of the camera to (0,0,0), I get the four corners of view frustrum, divide them by 2 to make sure that the corners are in front of the far plane, I create a quad-mesh with that vertices, and finally I add that mesh as child of the camera.
Not very elegant but it works.
I mean, if you create a quad that fills the whole screen, you can change the resolution as you like, and it will still fill the whole screen anyway, if you don't change the FOV and the aspect ratio.
I am not sure about that, but you should test it.
If I want to create a screen-aligned quad I set position and rotation of the camera to (0,0,0), I get the four corners of view frustrum, divide them by 2 to make sure that the corners are in front of the far plane, I create a quad-mesh with that vertices, and finally I add that mesh as child of the camera.
Not very elegant but it works.
maybe this is what you're looking for
http://www.irrforge.org/index.php/Resiz ... pect_ratio
http://www.irrforge.org/index.php/Resiz ... pect_ratio
You are right!
In my tests it is exactly the same to set 640x480 or 800x600, exactly the same objects are displayed, I display a 3d hud so it's important that things work like this.
And when I tried to change the ratio of resolution it looked like the objects were stretched. But I tried to set the screen res to 320x200 and actually I can se more things
Sorry for the wrong information
In my tests it is exactly the same to set 640x480 or 800x600, exactly the same objects are displayed, I display a 3d hud so it's important that things work like this.
And when I tried to change the ratio of resolution it looked like the objects were stretched. But I tried to set the screen res to 320x200 and actually I can se more things
Sorry for the wrong information
never mind
i figured out how i can solve my problem... i just multiply the viewprojection matrix with this matrix
A = [screenx/screeny,0;0,1]
(it's working in rendermonkey that way - in irrlicht i must use [1,0;0,screenx/screeny] - i think that's because the multiplication of the view and the projectionmatrix i s in another order than in other 3D engines...)
i figured out how i can solve my problem... i just multiply the viewprojection matrix with this matrix
A = [screenx/screeny,0;0,1]
(it's working in rendermonkey that way - in irrlicht i must use [1,0;0,screenx/screeny] - i think that's because the multiplication of the view and the projectionmatrix i s in another order than in other 3D engines...)