Bugs in buildProjectionMatrixOrthoLH

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
joy
Posts: 124
Joined: Tue Apr 27, 2004 9:15 am
Location: Germany

Bugs in buildProjectionMatrixOrthoLH

Post by joy »

After one and a half week working on this I am pretty sure that this function has some bugs. Using irrlicht 6.0. I tried this function in lot of variation but in neither one the objects overlap how they should. Here are some examples. In these examples I set the camera to position : 1.0f, 0.0f, 0.0f
and the function: MyMatrix.buildProjectionMatrixOrthoLH(29.0f,21.0f,-5.5f,5.5f);


ImageImage

In both cases at least the very right object should overlap with the object in the middle. But it is either in front or behind the object in the middle.

The second bug is I can't have the object closer to the camera than 0.1 in x So most of the rotations are not more than 20 degree before they vanish. It vanishes also, when it is closer than 0.1 in x direction. When I set the camera to 0.0f, 1.0f, 0.0f or 0.0f, 0.0f, 1.0f there are the same problems.

In all cases the camera can't be set further than -6.0f in z-direction.

Because I didn't understand how to set the camera and how to set the values for the function because I don't understand both , I can't fix the problem by my self.
joy
Posts: 124
Joined: Tue Apr 27, 2004 9:15 am
Location: Germany

Post by joy »

Hi, I was wrong the obejcts vanish already when the camera is set to position 2 or -2 in z-direction. only 1 and-1 can be set.

I tried instead of that function my own function which I calculate how it is done in OpenGL. Same problems! So I guess there is nothing wrong with the function and the matrices but something with the imaging...
joy
Posts: 124
Joined: Tue Apr 27, 2004 9:15 am
Location: Germany

Post by joy »

Finally I realized where the bug is. And solved it!
The function is correct. The only problem is, that I used the softwarerenderer because I had a viewport problem with OpenGL and DirectX. And this software renderer is not able yet to show the object in the correct position along the z-axis. I still don't know how to enhance the software renderer but I solved the viewport problem with the split screen tutorial and now the orthographic view with the camera at the position 0,0,1 works.
niko
Site Admin
Posts: 1759
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria
Contact:

Post by niko »

nice, less work for me. :)
Post Reply