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.

DarkBASIC Professional Discussion / make camera view look as if running

Author
Message
Mikeygd3
11
Years of Service
User Offline
Joined: 18th Dec 2013
Location:
Posted: 16th Jan 2014 05:04
i have this fps game and its good, but it would be way better if i could make the camera view to look as if i was running. i really have no clue. my player does go faster holding shift and up though
Rudolpho
19
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 16th Jan 2014 11:11
You could do some simple thing like update an angle so that it goes around 360 degrees in the time it takes for your walk cycle to do a single run (or well; as it's an fps you probably don't have an actual walk cycle but you get the idea; make something up that seems to fit with the speed you're running at). Then update the camera position like usual, but add cos(90 - angle) to the X position and abs(sin(angle)) to the Y position, multiplied by some reasonable factor. Of course that will look too smooth so you'd want to add some noise in too to make it seem more realistic.

There are probably better ways to go about it still but that's a basic way to do it to start from.


"Why do programmers get Halloween and Christmas mixed up?"
Sasuke
19
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 16th Jan 2014 12:58
Quote: "There are probably better ways to go about it"


Key Frame Animation is what it is. You'd set up an eye offset (position and angle) animation curves and when you move you interlope into the curves and proceed with the animation. Bit advanced but something to look at in the future.

"Get in the Van!" - Van B

Login to post a reply

Server time is: 2025-05-15 20:37:49
Your offset time is: 2025-05-15 20:37:49