I'm looking for a way to do reverse perspective with OpenGL and C++. For now, I'm using glFrustum to have a classic perspective, but I would like to know if a reverse pespective as presented here (https://en.wikipedia.org/wiki/Reverse_perspective and below) is possible ? If not, is there any other way with OpenGL to do this ?
How do reverse perspective with OpenGL?
962 Views Asked by attentionALaMouss At
1
There are 1 best solutions below
Related Questions in C++
- How to immediately apply DISPLAYCONFIG_SCALING display scaling mode with SetDisplayConfig and DISPLAYCONFIG_PATH_TARGET_INFO
- Why can't I use templates members in its specialization?
- How to fix "Access violation executing location" when using GLFW and GLAD
- Dynamic array of structures in C++/ cannot fill a dynamic array of doubles in structure from dynamic array of structures
- How do I apply the interface concept with the base-class in design?
- File refuses to compile std::erase() even if using -std=g++23
- How can I do a successful map when the number of elements to be mapped is not consistent in Thrust C++
- Can std::bit_cast be applied to an empty object?
- Unexpected inter-thread happens-before relationships from relaxed memory ordering
- How i can move element of dynamic vector in argument of function push_back for dynamic vector
- Brick Breaker Ball Bounce
- Thread-safe lock-free min where both operands can change c++
- Watchdog Timer Reset on ESP32 using Webservers
- How to solve compiler error: no matching function for call to 'dmhFS::dmhFS()' in my case?
- Conda CMAKE CXX Compiler error while compiling Pytorch
Related Questions in OPENGL
- How to fix "Access violation executing location" when using GLFW and GLAD
- getting Access violation writing location when calling glDrawElements caused by shader
- Experimenting with GLFW library: window boundary problem and normalized coordinates
- OpenGL Framebuffer/FBO RTT subpixel movement discrepancy
- Why isn't my glfw window showing anything?
- How can glPushMatrix affect the rotation of an object around a rotating object?
- g++ / vscode apparently cannot see my src folder? "cc1plus.exe: fatal error: src/glad.c No such file or directory"
- Does addition-assignment cause dependency chain in GLSL?
- Compiling C++ program with Opengl and Glut in windows
- Using Silk.NET in WinForms
- What happens when rendering an OpenGL buffer that has been padded with NULL (or another value)?
- How can I make a sphere follow an eight-like path in Python using OpenGL?
- OpenGL only rendering second triangle, first triangle not visible
- OpenGL shows black texture on quad
- My Visual Studio 2022 consistently gives me errors saying that the GLchar variable type is undefined
Related Questions in GLFRUSTUM
- Create a tight frustum around a 3D model bounding volume
- how do i calculate glFrustum parameters?
- Is it possible to render only a clipping-area of what gluLookAt sees?
- Perspective drawing in OpenGL using glFrustum
- How do reverse perspective with OpenGL?
- OpenGL appears to be using (far too aggressive) frustum culling which I can't see how to modify
- In which space to do Visible Surface Determination and how?
- Why is this object drawn different if I use glFrustum?
- LIne not displaying with glFrustum()?
- OpenGL ES (Android) scaled sphere cut by z near and far
- Is 0.00 a valid z value for vertices in OpenGL?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?

This question really intrigued me. I'm not entirely convinced that what I'm going to refer to now as 'Byzantine perspective' can be accommodated by a transform analogous to that provided by (pre-core profile) glFrustum. I have done some work on it though, inspired by derivations in
Computer Graphics: Principles and Practice (2nd Ed), and the formulation for the OpenGL CCS / NDCS.Unfortunately, the original S.O. site doesn't allow for embedded LaTeX, so the matrices will not be pretty. Consider this answer a work in progress
So far, I've derived the matrix transform resulting in what is sometimes referred to as the 'normalized frustum'. The far plane at
Z = -1, the near plane atZ = - N / F, and theR, L, T, Bplanes having unit slope. (this would be very clear given a good diagram)Call this matrix:
[F.p]. For any point:P = (x, y, - N, 1)^Ton the near plane, it's easy to demonstrate that the transformed homogeneous point lies on theZ = - N / Fplane. (Note:^Tis the 'transpose' operator to make it clear that this is in fact a column vector.)Likewise, given a point:
P = (x, y, - F, 1)^Ton the far plane, the transformed homogeneous point lines on theZ = -1plane.A Byzantine perspective requires another constraint - we'll use the variable
D, whereZ = - Dis a point analogous to the 'eye' atZ = 0, or the 'projection reference point' (PRP).As you have already gathered from the image you've provided, parallel lines converge at
Z = - D, rather than at the 'eye'. You don't want the image from the the point of convergence however. You want to visualise the effect from the 'front'. The question is - can we construct an OpenGL matrix similar to that provided byglFrustumwhich yields a Byzantine perspective? And can it be made to fit within a GL pipeline?What I've derived so far, is the 'normalized Byzantine frustum'. Again, the far plane is at
Z = -1, the near plane atZ = - N / F, andR, L, T, Bplanes have unit slope - albeit the negative slope of the regular frustum. (again a clear picture would be worth a thousand words here)Call this matrix:
[F.b]. TheX,Ycoordinate transforms are identical, but theZ,Wcomponent transforms differ. This is somewhat intuitive given that this is, in a sense, a 'reverse' of the orthodox view volume.Again, given a point:
P = (x, y, - N, 1)^Ton the near plane, the transformed homogeneous point lies on theZ = - N / Fplane, and the homogeneous transform of a point:P = (x, y, - F, 1)^Ton the far plane lies on theZ = -1plane.Given the similarities in the matrices, and the fact that only simple perspective transforms (and a few trivial scaling and translation matrices) are required to yield parallel projection matrices that conform to OpenGL clip coordinate space (CCS), and its NDCS projection, it seems likely that an OpenGL 'Byzantine' projection could be made to work. I just need more time to work on it...