Gamestudio Links
Zorro Links
Newest Posts
No connection to MT4
by JeyKey II. 10/29/26 09:34
Zorro plugin for Hyperliquid.xyz
by opm. 10/28/26 13:50
Icon "OP"
by JeyKey II. 10/27/26 07:03
ZorroGPT
by TipmyPip. 10/26/26 08:09
Chat Room for Zorro Programmers
by Haitao_Ren. 10/25/26 03:14
Trading Journey
by Haitao_Ren. 10/25/26 03:14
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
0 registered members (), 22,852 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
MaliceTheMaker, Haitao_Ren, JimSimons, julienp, julienper
19248 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