1

Please see the following image:

enter image description here

Which mathematical method or POV-Ray/OpenGL command will lessen the convergence of a grid like this? (The grid converges too quickly; theta should be 90 degrees, matching the center line, for this purpose.)

Perspective is still desired, but convergence should happen at a slower rate, as if the distance was shorter or you were using a telephoto lens.

Although this image is from Blender, the methods being used are OpenGL and POV-Ray so a solution in either method would be appreciated.

I have some lines modeled in OpenGL and POV-Ray.

I have tried location, look--at, angle, right and up in POV-Ray, including camera transformations like rotate, scale, translate and matrix.

In OpenGL I have tried gluPerspective, glFrustum and glDepthRange.

Does anyone have a solution to this problem?

(Also, looking down on the grid is not an option in this case)

1 Answers1

0

You're after an orthographic projection...

glOrtho()

glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(left, right, bottom, top, near, far);
glMatrixMode(GL_MODELVIEW);

It's always nice to be able to swap between orthographic and perspective though since moving around a scene in orthographic can take a while to get used to.

There's an image here... https://blender.stackexchange.com/questions/648/what-are-the-differences-between-orthographic-and-perspective-views

edit

To keep using perspective, but with less perspective effect, you can decrease the field of view parameter. Unfortunately this will make the projection appear to zoom in. To undo the zoom, move the camera back. You can then update the near/far accordingly if need be.

enter image description here

Community
  • 1
  • 1
jozxyqk
  • 16,424
  • 12
  • 91
  • 180
  • Thank you for the help and the code. I would like some perspective for realism, but not as strong as what the perspective camera gives. Is there a camera that is in between the strong perspective camera and perspective-less orthographic camera? – user2689489 Aug 23 '13 at 12:48
  • Thank you for the additional help. I have tried your suggestion, and while it seems to "zoom in" like a telephoto lens, the angle theta remains at 60. Is there any way to bring the angle theta to 85-90 degrees, so that it matches the angle of the central line in the grid diagram? – user2689489 Aug 23 '13 at 13:26
  • @user2689489 This should be possible with the same method, but you may need to ramp up the values (hopefully this doesn't introduce numerical instability. if it does maybe investigate glFrustum?). Calculating the position to shift back the camera and the near/far values implicitly is probably required. Lets say you want a perspective view of a single degree and the near plane to be 1 unit high, you'd have to move the camera back by 1.0/sin(1.0*toradians) is approx 50 units, then set your near to 50 and far to 1000 say. – jozxyqk Aug 23 '13 at 13:46