| 01-06-2010, 03:07 PM | #1 | |
'lo everyone i wanna calculate the x/y/z position of the four camera-corners a player can see I've included the "testmap" (changed shades should appear in the corners and one should be in the center - but it doesn't work, they're all spread over the entire map need this for some kind of advanced inventory (fullscreen, but with active items) |
| 01-06-2010, 08:44 PM | #2 |
It is likely impossible to get precise coordinates due to camera smoothing and all that crap. |
| 01-06-2010, 10:33 PM | #3 |
If the z height differentials in your map are rather minor, you could manually force the camera to not change height by periodically using SetCameraZ, and then you wouldn't have to worry about smoothing. (I haven't tested this so it might not look good / work properly) As for the actual formula, I think DGUI has functions that calculate this, although I don't know how reliable it is. |
| 01-07-2010, 11:56 AM | #4 |
In my map, the camera's drive, farz, zoffset and sight are constants, so that wont be a problem. I must only now the coords whe the cam's not moving, so smoothing won't be a problem. yea, but dgui's approach requres a lot of calculation, but most of it is usless for me (also due to the lack of comments) |
| 01-07-2010, 09:18 PM | #5 |
A locked camera won't help you much unless you have flat terrain. |
| 01-08-2010, 02:56 PM | #6 |
the height of the terrain is mostly never minds, cause i only need to calc them if the cam is standing still, so height would be constant. can't see your prob, I'm sry |
| 01-14-2010, 11:38 AM | #7 |
I respecificated my needs! The cam will never move in any direction and it'll be an frist-person cam (--> parallel to ground) now the problem is still the same, how to get these f***ing corner-coords!! |
