Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / FPS set camera above ground when ground is object

Author
Message
apophis
21
Years of Service
User Offline
Joined: 14th Jul 2003
Location:
Posted: 23rd Apr 2004 02:02
I am making a FPS game. In my game I made my level including the terrain with cartography shop and exported as a .x object. Since it is a first person shooter I need to have the camera a certain number of units above the ground. Since the ground can be stairs or the second floor of a building I cannot simply do
"object position y(2) + 2"
for the y coordinate of my camera. Also since my level is not a matrix I cannot use "get ground height." How can I get the camera to stay a certain number of units above whatever the ground is at the current time (stairs, 2nd floor, terrain, etc.)
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 23rd Apr 2004 02:08
make and control a dummy object like a cube or sphere, then stack your camera on top of it. Have a line or two of code that keeps the camera with the dummy object.

just one way to do it


Home of the VB.NET Class Builder Utility - Demo and FULL versions now available!!
apophis
21
Years of Service
User Offline
Joined: 14th Jul 2003
Location:
Posted: 23rd Apr 2004 02:30
After that what do I do with the cube to make it move above the ground. Thanks for the help.
apophis
21
Years of Service
User Offline
Joined: 14th Jul 2003
Location:
Posted: 23rd Apr 2004 02:33
I am using DBPro could you please give me some sample code.
apophis
21
Years of Service
User Offline
Joined: 14th Jul 2003
Location:
Posted: 24th Apr 2004 02:05
Someone please help!
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 24th Apr 2004 02:42
well you should have some form of gravity and a collision test to not let the cube pass thru the ground - this is how I do it for bsp


Home of the VB.NET Class Builder Utility - Demo and FULL versions now available!!
apophis
21
Years of Service
User Offline
Joined: 14th Jul 2003
Location:
Posted: 24th Apr 2004 02:51
Thanks I'll try it (a.k.a. expect me back soon when I fail).

Login to post a reply

Server time is: 2024-09-22 06:31:30
Your offset time is: 2024-09-22 06:31:30