Loading...
Logo
Processing Forum
Help!

We're setting up a simple video projection, or so I thought. 
I'd like to setup two projectors, each projecting on a different wall, meeting in the corner.

As their angle is orthogonal, I figured their fov to be 360/4 = 90 degrees, or half Pi.
They simply look along the two axes, with y axis up, this would be for left wall: 1, 0, 0 and for the right 0, 0, 1. 
 
With my eye in 0, 0, 0, their projection should perhaps be dollied a little along their respective axes. But no matter the value I translate along the axis, the image will not match perfectly. 

I've used both the core camera() function and OCD's implementation:

Left projection:
Copy code
  1.   // setup perspective

  2.   float cameraX = 0;
  3.   float cameraY = 0;
  4.   float cameraZ = 0;
  5.   float targetX = 1; 
  6.   float targetY = 0; 
  7.   float targetZ = 0;
  8.   float upX = 0; 
  9.   float upY = 1; 
  10.   float upZ = 0;

  11.   float fov = PI/2.0;
  12.   float nearClip = 0.001;
  13.   float farClip = 2000;

  14.   float aspect = 4/3.0;

  15.   cam = new Camera(this,
  16.   cameraX, cameraY, cameraZ,
  17.   targetX, targetY, targetZ,
  18.   upX,     upY,     upZ,
  19.   fov, aspect, nearClip, farClip);

  20.   cam.dolly(halfroomsize);
Right:

Copy code
  1.   // setup perspective

  2.   float cameraX = 0;
  3.   float cameraY = 0;
  4.   float cameraZ = 0;
  5.   float targetX = 0; 
  6.   float targetY = 0; 
  7.   float targetZ = 1;
  8.   float upX = 0; 
  9.   float upY = 1; 
  10.   float upZ = 0;

  11.   float fov = PI/2.0;
  12.   float nearClip = 0.001;
  13.   float farClip = 2000;

  14.   float aspect = 4/3.0;

  15.   cam = new Camera(this,
  16.   cameraX, cameraY, cameraZ,
  17.   targetX, targetY, targetZ,
  18.   upX,     upY,     upZ,
  19.   fov, aspect, nearClip, farClip);

  20. cam.dolly(halfroomsize);

Previously, we have achieved pretty good results with the standard 60 degrees (PI/3.0) perspective and 30 degree camera rotation(PeasyCam.rotateY()).Which is odd isn't it? Shouldn't that have been rotateY(fov)?

Replies(4)

I must've misunderstood where this ratio stands for, because changing its value to 1 solved the problem, and the projections behave as expected. :)
Can anyone help? I'm having some similar issues with regard to fov.  

Essentially I want to change the fov for the camera from what i believe is the default of 60 degrees (Pi/3) to 90 degrees(Pi/2). Unfortunately there is no option to adjust fov in the camera() function.  Like rapatski, I am trying to line up screens that are placed at right angles to each other and I just can't get them right.  I tried using the perspective() function but this is not really the answer and I still can't get them lined up right.  

Is the OCD library the answer ? or does anyone know of a way that I can adjust the fov of the standard camera?   
Hi cjflyn, in the end we went with the OCD solution as described above, which worked with an aspect set to 1.0. For us, the aspect ratio didn't matter (how ever strange that may sound) so I didn't bother actually checking if setting OCD's aspect parameter to 1.0 actually warped the image. If not, I'd say that's the best solution. See our end result here:  http://www.tiemenrapati.com/blog/?p=529

perspective() IS the solution if you don't want to work with OCD. When used in conjunction with camera() you have control over all the camera settings. (which when combined *coincidently* happen to be the same as the ones that go into OCD's Camera() constructor.)
Hi rapatski,

I implemented OCD yesterday and so far it looks good. but will hopefully know for sure after some testing this weekend. Thanks for getting back to me.

Your installation looks awesome by the way !