Project

General

Profile

« Previous | Next » 

Revision 390ebefc

Added by Leszek Koltunski almost 8 years ago

Fix with Projection

View differences:

src/main/java/org/distorted/library/DistortedFramebuffer.java
67 67
      {
68 68
      if( mFOV>0.0f )  // perspective projection
69 69
        {
70
        float left   =(-mX-mWidth )/mHeight;
71
        float right  =(-mX+mWidth )/mHeight;
72
        float bottom =(-mY-mHeight)/mHeight;
73
        float top    =(-mY+mHeight)/mHeight;
70
        float left   =(-mX-mWidth/2 )/mHeight;
71
        float right  =(-mX+mWidth/2 )/mHeight;
72
        float bottom =(-mY-mHeight/2)/mHeight;
73
        float top    =(-mY+mHeight/2)/mHeight;
74 74
        float near= (float)( (top-bottom) / (2*Math.tan(mFOV*Math.PI/360)) );
75 75
        mDistance = (int)(mHeight*near/(top-bottom));
76 76
        float far = 2*mDistance-near;

Also available in: Unified diff