HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Camera-Calculating

01-06-2010, 03:07 PM#1
Tot
'lo everyone

i wanna calculate the x/y/z position of the four camera-corners a player can see
Image


Zoom (requires log in)

corners are represented by the blue dots

cam field sight, cam field turn and cam perspective are angles (in deg), all other values are distances



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)
Attached Images
File type: jpgWC3ScrnShot_010610_165324_01.jpg (634.8 KB)
Attached Files
File type: w3xCamTest.w3x (19.5 KB)
01-06-2010, 08:44 PM#2
Anitarf
It is likely impossible to get precise coordinates due to camera smoothing and all that crap.
01-06-2010, 10:33 PM#3
grim001
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
Tot
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
Anitarf
A locked camera won't help you much unless you have flat terrain.
01-08-2010, 02:56 PM#6
Tot
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
Tot
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!!