Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
4 registered members (NewbieZorro, Grant, TipmyPip, AndrewAMD), 13,346 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Camera bob up/down with player walk animation #392873
01/29/12 02:13
01/29/12 02:13
Joined: Mar 2006
Posts: 14
California
R
Rockfleet Offline OP
Newbie
Rockfleet  Offline OP
Newbie
R

Joined: Mar 2006
Posts: 14
California
I'm trying to get my first-person camera to bob up and down convincingly while my player walks. Any simple suggestions? I've been looking . . .

Re: Camera bob up/down with player walk animation [Re: Rockfleet] #392875
01/29/12 02:43
01/29/12 02:43
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Either grab the position of a head vertex with vec_for_vertex and set camera.z or do something as follows:

var camera_bob = 0;
...
camera_bob += player_speed*time_step; // player_speed != 0 if player is moving
camera_bob %= 360;
camera.z = player.z+player.max_z+8*sinv(camera_bob);

Last edited by Superku; 01/29/12 02:44.

"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: Camera bob up/down with player walk animation [Re: Superku] #392876
01/29/12 02:51
01/29/12 02:51
Joined: Mar 2006
Posts: 14
California
R
Rockfleet Offline OP
Newbie
Rockfleet  Offline OP
Newbie
R

Joined: Mar 2006
Posts: 14
California
Very nice! Thanks a bunch! I'll work with this - see if I can make it work.


Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1