| 11-08-2003, 01:39 AM | #1 |
Is there any way to determine the Z coordinate of a point on the map, or even a unit? here's the deal: My camera system pans the camera to a point in front of whatever unit you're controlling - so that you can see ahead of you. Most of the time, it works Perfectly. However: When you walk on uneven terrain, for example the edge of a cliff, the camera gets confused because it is targeting a point that is below or above the unit. I'm attaching a diagram so you can see what I mean. Diagram: If (a) is the unit, (b) is where the camera is targeting, and (c) is the camera. I want the camera to target a point in the air above (b) at a height even with (a). |
| 11-08-2003, 01:52 AM | #2 |
Is what you are asking is how to make the target a z offset? If so ill try to tell you where to do that (not on my comp right now), set camera property, z-offset Camera target, or something like that. Ill tell you the exact thing in a couple of hours when i can check. If you are asking is how do you check for the terrain height, I dont think there is a way to do that. |
| 11-08-2003, 02:53 AM | #3 |
There's no Camera - Set target Z offset action... is there a jass function? And really it's no good unless it's possible to check the difference between the Z coords of the unit's position and the camera's target position... |
| 11-08-2003, 03:08 AM | #4 |
Well... I can think of one way... try this: Detect the cliff height on the spot the unit is standing. Increase the Z Offset by 128, or decrease, depending on the situation. |
| 11-08-2003, 03:31 AM | #5 |
Thought of that... cliff height will only work if there's a cliff, not a steep slope... Thanks though. I think it may end up being the only option to use that and create cliffs that are ramps everywhere there are drops... |
| 11-08-2003, 07:00 AM | #6 |
Now that I am home i will show you where the z offset is. It is under Camera - Set Camera Field (Timed), under the label Z Offset. Example Camera - Set Player 1 (Red)'s camera Z Offset to (Current flying height of TestWagon) over 0.05 seconds |
| 11-08-2003, 04:48 PM | #7 |
That's funny... the first place I looked was under Camera - Set Field.... And in my editor there's no Z-offset function... take a look: |
| 11-08-2003, 04:54 PM | #8 |
1) There is NO way to detect terrain height. The GetTerrainHeight() function doesn't exist. 2) What editor are you using? It shows up in UMSWE 4.0. |
| 11-08-2003, 05:01 PM | #9 |
I'm just using the straight TFTWE. |
| 11-08-2003, 05:06 PM | #10 |
Then get UMSWE 4.0! Everyone uses it (and WEU)! |
| 11-08-2003, 06:10 PM | #11 |
Hmmm. Well, is there any way to detect the Z coordinate of ANYTHING except the current camera's source or the current camera's target? |
