Advertisement

Projection

Started by April 14, 2003 09:34 PM
10 comments, last by vanillacoke 21 years, 10 months ago
Does anyone here use something other than the standard projection formula for simple perspective viewing? I''ve noticed that when the camera angle gets large, the standard formula causes ugly distortions that none of my friends ever notice. I''ve seen these distortions in commercial first person shooters, and they really bother me. The standard formula determines the intersection of the incoming light ray with the viewing plane. I want to use, instead of a viewing plane, a viewing sphere. They would be similar, and the equation would be pretty simple, and I''m fairly sure that it would correct the problem. Obviously, I wouldn''t use the whole sphere, only a fraction of the sphere''s surface area. The sphere would effectively make the distance to the "viewing surface" constant, which is exactly what I want. Does anyone have any information on a spherical perspective projection formula? I won''t be surprised if no one here has ever seen the distortion. Check out Goldeneye if you don''t believe me. I know that the formula wouldn''t be practical for real time rendering, because of an ATN, but I do mostly images or animations anyway.
You know what I never noticed before?
i know what you are talking about, and i believe it is quite a known issue. i thought there are ways around it, in opengl you can set the perspective calculations to a higher level of complexity i thought.
i think this is just a approximation though. on second thought i dont even know if it would have benefits to project to a sphere: youd have to convert to screencoords sooner or later anyway.
Advertisement
Well, I think I already know a way to convert to screen coordinates that would eliminate the distortion. I was mostly wondering if ANYONE other than me had ever seen this effect. Now I know I''m not crazy. Does anyone have any technical information on this?
You know what I never noticed before?
There is no good solution to that distortion. You are simply trying to cover an angle larger than the one your monitor covers, and there is no way to do it. If you have a very large screen, projecting linearly is the right thing to do. If you want to emulate fisheye or super wide angle lenses, you have to introduce some other distortion.

What is the solution you found?
Alvaro is right. However, instead of getting a bigger screen you could just sit closer to the one you''ve got.
Normally, to find screenx and screeny from (x,y,z), you would find the ray from the camera to the point, and then find the intersection of the ray with the viewing plane. Instead of using a viewing plane, I will use a viewing sphere, using a parametric expression of a sphere (I haven''t actually implemented this idea yet, so I don''t know if it works). Once I project the 3D points onto the surface of the sphere, I will use the parametrization the find equivalent screen coordinates for the points. As far as I can tell, this is essentially how cameras and eyes work, sort of.
This formula would require the x- and y-coordinates to be dependent on each other, which would be kind of annoying. Another approach would be to use a cylindrical projection individually for each coordinate. This would be easier and faster, but would still have a little distortion around the corners.
You know what I never noticed before?
Advertisement
As far as I can tell, this is essentially how cameras and eyes work, sort of.

Well, no. A camera projects the light onto a plane film, so the projection is not spherical at all (unless you use special lenses). And since your monitor is plane as well, plane projection makes a lot of sense. By using spherical projection you will no doubt introduce distortions (most notably, straight line will no longer be straight). However, you might find it useful anyways.

http://wouter.fov120.com/gfxengine/fisheyequake/compare.html
yes, (foto)cameras do indeed project to a plane: and so they have to same distortion as a monitor.
mind that the projection formulas are correct: a physical object, for example a camera, has the same problems. this distortion is only relative to that projection on our eye, witch is after all a sphere. (at least the area on witch the light is projected is an arc of, i guess about 10 degrees)
so you could project your points in 3d space to a sphere, i suppose its theoreticly very possible, but what end would it serve? youd have to transform these coordinates on this sphere to coordinates on screen sooner or later anyway. for projection that seems 100% correct to our eyes, youd need a hollow monitor.
When you use the plane projection formula, you are still converting space points to screen points. I don't think a distortion will arise from transferring sphere points to screen points. Obviously, there will still be problems. I have a particular problem I want to solve.
Imagine a cube outline, sides parallel to the axes, 1 unit on a side, sitting at (0,0,5). The camera is at the origin looking directly at the center of the cube, down the z-axis. It should look like this:
_______
|\_____/|
|| ||
|| ||
||_____||
|/_____\|
This probably isn't going to show up correctly...

Well, you know what I mean. If you rotate this cube (each point individually) around the circle x^2+y^2=25, I think that the image on the screen should be exactly the same, with a translation that depends on the angle of rotation. With the standard projection formula, this does not happen (actually, I'm not sure about that. I remember writing programs to test it and seeing the distortion, but I could definitely be wrong about this). The cube gets distorted as it rotates. With a spherical projection formula, hopefully, this wouldn't happen, because no point on the circle is really any different than another point, except for where on the screen it corresponds to.(this is not true on a projection plane, as the distance to the camera is different at every point.)

I think that a spherical or cylindrical projection formula would correct this, but I haven't done a lot of research. Anyway, I really can't stand the distortion from the plane projection formula, and I might be able to stand a different kind of distortion.

By the way, my monitor is actually curved, but even if it weren't, images would still not appear realistic.

And I'm pretty sure that the mechanism of optical cameras can't really be described as projection. I think refraction is an entirely different method, with different mathematical implications.

Thanks for the link, AP

Edit: tried to fix cube...


[edited by - vanillacoke on April 16, 2003 11:06:07 PM]
You know what I never noticed before?
If you want to eliminate all distortion, you have to model how the light from the screen reaches your eyes. That would include the size and shape of the screen as well as the placement of your eyes. The bottom line is, the viewing angle of the virtual camera cannot be larger than the actual viewing angle of your eyes to the screen, without introducing some kind of distortion.

This topic is closed to new replies.

Advertisement