HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Camera Z Height

01-02-2008, 04:59 AM#1
Ammorth
I'm working on a new camera system which allows for true Z manipulation. I use the following function to find out the height the camera is above the ground:

Collapse JASS:
private function GetLocZ takes real x, real y returns real
    local real tempz = GetCameraField(CAMERA_FIELD_ZOFFSET)
    local real tempx = GetCameraTargetPositionX()
    local real tempy = GetCameraTargetPositionY()
    local real outz
    call setCamCords(x, y)
    set outz = GetCameraTargetPositionZ() - tempz
    call setCamCords(tempx, tempy)
    return outz
endfunction

This function takes into account the "smoothing" done by the camera when going over un-even terrain.

The function itself seems to work fine, except there is a slight transition problem. The camera seems to jump every 512 game units. I don't know if this is an issue with GetCameraTargetPositionZ() or my script.

Attached is my current system displaying the demo. The camera script is not finished, so bear with it.

In the demo map, there is 2 variables shown:

Camera Z: the calculated Z value using the above function
Height: the height the eye is above the ground

Watch the height closely, it should stay around 800, which is does. But within the sequence, it suddenly changes multiple times (changes of +/- 2).

Did I do something wrong, or does anyone have a way I can clean it up so it doesn't bounce?
Attached Files
File type: w3xCineMaster.w3x (30.5 KB)
01-02-2008, 05:05 AM#2
redscores
I think the cameras are not so quite perfect done by blizzard, you see in some cinematics that when the camera reaches a point it short bumps or shakes, to signalize the stop, know what i mean?
01-02-2008, 12:52 PM#3
Silvenon
What's wrong with Anitarf's CinematicSystem? I don't get why people are still making new ones, when there is already a perfectly good one.
01-02-2008, 04:28 PM#4
Ammorth
Quote:
Originally Posted by Myself
true Z manipulation

If you watch the demo, the camera doesn't go up and down over the terrain, but it goes in a straight line. I don't plan to release this, but use it personally.
01-02-2008, 06:01 PM#5
Toadcop
lolzor... the best on FPS mod is the camera Z correction :pray: the guy\guys really rock to that time...
if you don't know what i mean so forget it =)
// TcX have cam Z correction btw.
01-02-2008, 09:22 PM#6
Ammorth
The FPS mod is practically the same method I am using, except they use GetCameraEyePositionZ() vs GetCameraTargetPositionZ().

I checked your map, and you get the eye position and then translate it to the target position. Does this mean eye position is more accurate than target position?
01-02-2008, 09:42 PM#7
redscores
yes, cause merely Z calculation is not so accurate like taking a instance and form something out of. It is the crappy cam made by blizzard which needs to use instance, sometimes in my maps with cams the Y screws up and shows odd things without any change of the sight.
01-02-2008, 10:25 PM#8
Toadcop
omg here... X_X

Collapse JASS:
call SetCameraField(CAMERA_FIELD_ZOFFSET,GetCameraField(CAMERA_FIELD_ZOFFSET)-GetCameraEyePositionZ()+myglobalZoffseet,0.1) 
//myglobalZoffseet - well yes it's a Z cord in space =) aka it will keep this height at least it will try it ^^

// i just simple want what you find it self out. (TT xD)
01-02-2008, 11:12 PM#9
Ammorth
I know of both functions, I just don't understand why using EyePositionZ vs TargetPositionZ. EyePositionZ changes depending on the different camera angles and shit. I want the target to remain at the same offset.

The problem is that the camera map (whatever the z map that tells the camera to go to) seems to be broken. Every 512 units, the height changes instantly by ~2 on uneven terrain.

I did come up with the function in the first post on my own, and it works... except blizzard screwed up the camera map.

GetCameraEyePositionZ() bounces as well (I just tested).

Check the attached map on the first post to see the bouncing I am talking about.