- Joined
- Jun 6, 2008
- Messages
- 51
So, while my main project rots away in the back of my mind, I turned my attention to an old interest:First Person Cameras. I still haven't installed tFT on my laptop, so I wanted to see how much I could do with the RoC functions. I already had made a couple of FPS maps on tFT which were leaky as hell, so I had a general idea of what I had to do.
However, those old maps were limited because back then I hadn't figured out how to move the camera in the Z direction correctly, so the terrain was flat. Well, I got a bit ambitious and wanted to overcome this, so after a bit of fiddling around I found that calling SetCameraTargetControllerNoZForPlayer() over and over again would almost keep the camera at a Z appropriate to the terrain height.
I say almost because in spots were the terrain was higher than the base cliff height (because of cliffs or raised terrain) I noticed that the camera's Z Offset would lower lower and lower, the higher up I went, even going so far as to make the camera target go below the terrain. I used GetCameraTargetPositionZ() to find out what was happening and found that the camera target wasn't climbing to the same Z height as the unit the camera was supposed to be targeted on.
GetLocationZ() isn't available unless you install tFT, so I wanted to ask you: Is GetLocationZ() any better at finding the terrain's Z height than SetCameraTargetController() GetCameraTargetPositionZ() is?
If it is, a FPS camera that adjusts to bumpy terrain should be only take a little more work with tFT functions.
-----
Anyone know what bug Purplepoot is talking about [post=338101]here[/post]?
However, those old maps were limited because back then I hadn't figured out how to move the camera in the Z direction correctly, so the terrain was flat. Well, I got a bit ambitious and wanted to overcome this, so after a bit of fiddling around I found that calling SetCameraTargetControllerNoZForPlayer() over and over again would almost keep the camera at a Z appropriate to the terrain height.
I say almost because in spots were the terrain was higher than the base cliff height (because of cliffs or raised terrain) I noticed that the camera's Z Offset would lower lower and lower, the higher up I went, even going so far as to make the camera target go below the terrain. I used GetCameraTargetPositionZ() to find out what was happening and found that the camera target wasn't climbing to the same Z height as the unit the camera was supposed to be targeted on.
GetLocationZ() isn't available unless you install tFT, so I wanted to ask you: Is GetLocationZ() any better at finding the terrain's Z height than SetCameraTargetController() GetCameraTargetPositionZ() is?
If it is, a FPS camera that adjusts to bumpy terrain should be only take a little more work with tFT functions.
-----
Anyone know what bug Purplepoot is talking about [post=338101]here[/post]?
Last edited: