Project

General

Profile

« Previous | Next » 

Revision 98455aa2

Added by Leszek Koltunski over 7 years ago

Turn the former 'FOV' app into 'Projection' app that also checks the (x,y) the camera looks at.

View differences:

src/main/java/org/distorted/library/Distorted.java
91 91
  static int mTextureCoordH;    // pass in model texture coordinate information.
92 92
  static int mProgramH;         // This is a handle to our shading program.
93 93

  
94
  static DistortedFramebuffer mFramebuffer = new DistortedFramebuffer(0);
94
  static DistortedFramebuffer mFramebuffer = new DistortedFramebuffer(0); // output to the screen
95 95

  
96 96
///////////////////////////////////////////////////////////////////////////////////////////////////
97 97

  
......
284 284
// Public API
285 285
///////////////////////////////////////////////////////////////////////////////////////////////////
286 286
/**
287
 * Sets Vertical Field of View angle. This changes the Projection Matrix.  
287
 * Sets Vertical Field of View angle and the point the camera is looking at. This changes the Projection Matrix.
288 288
 *   
289 289
 * @param fov Vertical Field Of View angle, in degrees. If T is the middle of the top edge of the 
290 290
 *            screen, E is the eye point, and B is the middle of the bottom edge of the screen, then 
291 291
 *            fov = angle(TEB)
292
 * @param x   X-coordinate of the point the camera is looking at. -scrWidth/2 < x < scrWidth/2
293
 * @param y   Y-coordinate of the point the camera is looking at. -scrHeight/2 < y < scrHeight/2
292 294
 */
293
  public static void setFov(float fov)
295
  public static void setProjection(float fov, float x, float y)
294 296
    {
295
    mFramebuffer.setProjection(fov,0.0f,0.0f);
297
    mFramebuffer.setProjection(fov,x,y);
296 298
    }
297 299
  
298 300
///////////////////////////////////////////////////////////////////////////////////////////////////

Also available in: Unified diff