Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This is not how geometrically-correct pinhole-camera perspective projection works; Pomax is approaching the vanishing points exponentially rather than hyperbolically, which is why straight lines turn into curves. If you work out the geometry of the pinhole camera setup [edit: with a flat imaging plane], you find that you're just doing a division (conventionally, dividing by the Z-coordinate in camera space, though you don't have to set it up that way) instead of an exponential. This is a "projective transformation", and those do map straight lines to straight lines: https://en.wikipedia.org/wiki/Projective_transformation

If you have a sufficiently wide field of view, even the standard projection transformation gives you things that look pretty "distorted", which is a fun trick often used in art photography. Also fisheye lenses are often designed to do a non-projective transformation and get effects you can't theoretically get with a pinhole camera, like mapping straight lines to curved lines as Pomax does.

Pomax's invention is super cool, even though it isn't the usual 3D→2D mapping motivated by pinhole-camera geometry. Weird is good! I wonder if there's a version of it in which straight lines become curves, but polynomial curves of some reasonable degree, or maybe something involving square roots and division, so we can rasterize them without computing a bunch of exponentials? Is that even a reasonable way to seek optimizations in 02021?

Pomax may have a good point that projective transformations aren't "strict three-[vanishing]-point perspective" because, instead of having three vanishing points, they have an infinite number of vanishing points, a point others have made in the comments here. The profoundly weird and cool aspect of Pomax's invention is that every line converges to one of those three points.



You can get distorted projections with pinhole cameras too, as long as your sensor is curved. Fisheye is impractical, but cylindrical projections are easy. Common way to do pinhole photography is with an oatmeal box, which is a cylinder.

https://sdsu-physics.org/assets/PDFs/oatmeal_pinhole_camera....

I'm not really trying to nitpick here, just like talking about pinhole cameras. With a flat image plane the pinhole lens is "rectilinear", but the beauty of pinhole cameras is that you can project the image onto any shape you want without affecting focus.


Oh, that's an excellent point! I guess I didn't even think about that, which shows how much experience I have doing actual pinhole photography in the physical world :)


> Pomax is approaching the vanishing points exponentially rather than hyperbolically

Exactly this. To put it in drawing terminology, the distance of a line towards the vanishing point is related to the angle from the camera (station point) projected back to the picture plane. Images like this may be of assistance for those of a computer and not hand drawing background https://guidetodrawing.com/site/assets/files/1082/gtd-235.79...

An exponential ratio as used by the article could maybe be described as assuming the camera is 0 distance from every point drawn.

[Edit: Really great article though - the kind of thing I love to see is looking at a complex problem with established solutions from first principles again]


That diagram is very confusing if you aren't aware that (1) the object being projected is a shed; (2) the perspective projection is incomplete.

Full article: https://www.guidetodrawing.com/linear-perspective/two-point-...

I'm taking an online drawing perspective class right now, and finding that much of what I've been learning is covered right on that site! Pretty neat stuff.


> An exponential ratio as used by the article could maybe be described as assuming the camera is 0 distance from every point drawn.

Hmm, wouldn't that give you an orthographic or isometric projection, or another member of that family, rather than this crazy exponential thing?


It seems to me that if you want some fancy curvilinear perspective, the simplest way is to render the scene normally (or make six renderings in a cubemap if needed), then texture-map it onto a suitable shape. That should work for any rearrangement of light rays, as long as they are straight and come to a point camera. Might get more fun if you want curved light or a camera extended in space :-)


Well, that won't give you the "strict three-point" property, where all 3-D lines asymptote to just one of those three points. More broadly, there are a wide range of mappings from 3-D to 2-D that use information that is lost in the standard divide-by-Z technique; some of them are used in automated optical inspection systems, for example.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: