[Solved]About oblique projection.

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
lvgeng
Posts: 38
Joined: Fri Aug 14, 2015 4:35 pm

[Solved]About oblique projection.

Post by lvgeng »

Image

I want to render something while using oblique projection... but it seems that irrlicht only provides orthographic projection.
I tried to write the projection matrix by myself but it seems that it doesn't work as what I expect.

Besides... the projection matrix I read from the camera seems to be something different...
https://en.wikipedia.org/wiki/Orthographic_projection
https://en.wikipedia.org/wiki/Oblique_projection

Do we have some official way to solve it?

===========================================
Currently.... I guess the only way is to write the matrix by yourself.
Something need to be careful about is that the function for matrix products works in a strange way...

===========================================
Last edited by lvgeng on Thu Jan 28, 2016 5:16 pm, edited 1 time in total.
Mel
Competition winner
Posts: 2293
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

Re: About oblique projection.

Post by Mel »

It shouldn't be too hard to create an oblique projection, the only point is that an oblique projection combines both a projection matrix that wraps the vertices of the objects, and a direction provided by the view matrix. If you can combine both properly, it shouldn't be hard to achieve any of the projections you want. The view matrix is easily obtained by setting a camera position, a camera target and a up vector that matches the view orientation you want (i.e. the view direction = camera target - camera position, and the up vector is +y in all cases) So, the rest of the problem is obtaining the projection matrix.
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
Post Reply