Orthogonal Rendering for Groundviews

Started by adler, September 15, 2015, 06:29:47 PM

Previous topic - Next topic

adler

Hello,

i found only quite old posts about rendering using orthogonal projection. I would like to use it to render a second viewport
with a groundview for orientations, so i would render from top down without perspective.

Has something changed regarding that Topic?


Greetings

Gatobot14

why dont use a camera that points exactly to the ground? how much that can affect your gameplay?

adler

Hey,

it is not against you but it is funny if somebody write about a problem and get answers like
"why would you do this" or "can you do it a different way"? Belive me that i have my reasons.

I never wrote that i code a game :) I want to interactively place positions on the groundview.
This also means that i have to place corners of a polygon that will be tesselated afterwards.
In perspective projection a high geometry (a building) would be an obstacle to parts of the
ground. Only in orthographic Projection i do not have this.

It could be an alternative to use a small fov and a far distance. This would be a compromise
not a solution. I do not see the reason why it should be forbidden to the the projection matrix.
This would be a basic feature to create modelling tolls and authoring systems as well. Show me
a 3D Modelling Application that does not support orthographic rendering and let me consider a
Gameeditor as some kind of modelling App.

Greets

adler

I found the answer and it is no.

Camera has a getProjectionMatrix which some can override to set a orthogonal projection matrix. BUT this Matrix is not used in the Renderer. In GLRenderer.setFrustum the camera parameters are set, but here the parameters are derived from fov specification. Because it is private it is not allowed to override.

Nevertheless - i would like to suggest Ortho Rendering as Feature Request. I knew this would make things like billboards or picking in some topics more complicated but it could be sufficient to support only the rendering orthogonal.

Greets

EgonOlsen

It's not supported (as you've found out already) and I've no plans for adding support for. If you are using OpenGL ES 2.0, you can of course inject your own projection matrix into the shader in addition and use that in your calculations. It may interfere with the engine's culling, but there should be a way around this if it becomes a problem.

I hope this helps somehow...