Jump to content
  • Advertisement
Sign in to follow this  
Gazoo101

OpenGL Inverse 3D Trapezoid projection

This topic is 2577 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey Guys,

This question requires a bit of explaining, so let's hope I succeed. Is there a way for get the hardware rendering pipeline to do the following with OpenGL:

Imagine the rasterizing engine in OpenGL shoots out rays to detect the color of each pixel. I know it doesn't, but it makes explaining this a million times easier. So for each pixel, one ray is shot out from the point of perspective (i think is its name), through the viewplane and into the scene. Now imagine you project the scene orthographically, and you set two cameras up on the opposite end of the scene. If you align the two cameras up exactly to face each other, the rays from the one camera will pass through a pixel on one view plane and eventually through the exact corresponding pixel in the view plane of the other camera. So in a very pixely 5x5 image we'll have 25 rays passing through our scene, each intersecting 2 points on two different view planes. All the 25 lines are of course parallel. Here's the tricky part. Now imagine I make one camera use a perspective projection, and I still want the rays to hit the corresponding pixels in the opposite viewplane.

So the view volume of the perspective projection camera has now become the familiar pyramid, and the other cameras viewing volume is a 3D trapezoid (or a trapezoidal prism afaik). Is it possible to muck around with the projection matrix so I get this weird projection? If so - any online resources anyone knows about?

Thanks a bunch,

Gazoo

Share this post


Link to post
Share on other sites
Advertisement
Hmm... normally you divide a vertex position from screen by its z component + fancy math, you mean you want to kind of multiply it Iinstead?

Unless opengl can do it through editing function params you could do it in a shader i think...

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!