HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Derive 4 Corner Points for Camera View

12-08-2007, 12:59 AM#1
PandaMine
Basically I require for my next version of my AMHS system and since I know nothing about how Blizzards cameras work I need to get the 4 corner points of a players current view in the camera. The 4 points also needs to take into account if a user changes camera angles (with roll which is done by scrolling your mouse and rotation which is done by delete/insert) THEY HOWEVER DO NOT NEED TO TAKE INTO ACCOUNT CINEMATIC MODE, i.e. only the points required when you view the map normally in a game and not when the cameras are manipulated in cinematic mode. Here are some screenshots to make it easier to understand, the points required are illustrated in the red circles

REP WILL BE GIVEN TO ANYONE THAT HELPS

In normal camera view
Zoom (requires log in)

When the camera is rotated with insert/delete
Zoom (requires log in)

When the pitch (or camera of attack) is changed with mouse scroll
Zoom (requires log in)

Here are some of the functions that would be required in order to calculate the 4 points
GetCameraTargetPositionX() and GetCameraTargetPositionY() = Gives the middle point in the screen

GetCameraField(CAMERA_FIELD_ANGLE_OF_ATTACK)) = Will give the angle of attack, in normal view it is 5.306 and when you scroll with your mouse fully it is 5.847

GetCameraField(CAMERA_FIELD_ROTATION)) = Will give the rotated angle achieved by pressing insert/delete, it appears to be a normal radian angle (at normal view it is 1.571 which is pi/2 )

Some extra notes
The 4 points will always form a trapezoid, never a rectangle (even in normal view its still a slightly skewed trapazoid). Another thing is that in normal view, taking the middle points of map view (i.e. GetCameraTargetPositionX() and GetCameraTargetPositionY()) horizontally from one end to the map to the other it appears to be 1800 units (900 from middle to left and 900 from middle to right). Here is a screenshot displaying what I mean
Zoom (requires log in)
NOTE: This is ONLY from the middle, on the top it would be less then 900 units and on the bottom it would be greater (this is due to the trapezoidal shape of the camera view)
Attached Images
File type: jpg01.JPG (61.0 KB)
File type: jpg02.JPG (61.3 KB)
File type: jpg03.JPG (71.7 KB)
File type: jpg04.JPG (69.0 KB)