Hey everyone.
So here’s my pickle. I’ve got a game where we have a 2D background and 3D objects in the foreground. Everything is drawn in Ortho mode. Originally, we had our artist drawing a psuedo-3D perspective that was mathematically easy to determine for us: rotated 45 degrees then “squished” vertically by tan(30). Effectively this creates a rather nice looking fake isometric view which is very easy to put in programmatically. Basically, all logic is done as if everything exists in a simple top-down 2D grid, then the resulting positions are rotated 45 degrees around the center of the playing area, then their Ys are scaled by tan(30). Simple and looks good.
It turned out that we changed our art style and wanted to be able to reuse assets, so the artists are now creating the levels in 3D and then exporting the renders as the new backgrounds. This is a literal 3D perspective, obviously. I know the rotation, height, etc of the camera in the 3D modeling program, but that doesn’t make it any easier to figure out how to programmatically translate a 2D grid to match the perspective. I’ve tried scaling based on distance from the camera, but I’m having trouble matching it exactly.
My question:
Is there any simple way to get OpenGL to do this for me? If not, any ideas on how I can get this implemented? I just feel like this exact thing must have been done already before (like in FFVII, sort of), so it can’t be rocket science.
Thanks a lot, everyone.
Eli