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
0 registered members (), 18,654 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
Moving in direction #235192
11/06/08 13:16
11/06/08 13:16
Joined: Sep 2008
Posts: 13
Croatia
ponco123 Offline OP
Newbie
ponco123  Offline OP
Newbie

Joined: Sep 2008
Posts: 13
Croatia
Hi!Can tell my somebody how to camera move forvard but in direction which it is.Thanks

Re: Moving in direction [Re: ponco123] #235296
11/06/08 21:22
11/06/08 21:22
Joined: Nov 2007
Posts: 1,143
United Kingdom
DJBMASTER Offline
Serious User
DJBMASTER  Offline
Serious User

Joined: Nov 2007
Posts: 1,143
United Kingdom
You need to use the relative direction vector (local coordiantes, rotation coordinates) not the absoulte direction vector (world coordinates).

Here is a little action that provides a traditional FPS style movement...

Code:
action act_player()
{
var vec_player_movement[3];
var player_speed = 4;
var player_eye_height = 30;
player = me;

while(player!= NULL)
{	
my.pan -= mouse_force.x*player_speed*time_step;
camera.tilt += mouse_force.y*player_speed*time_step;
camera.pan = my.pan;
camera.tilt = clamp(camera.tilt,-70,70);

vec_player_movement[0] = player_speed * (key_w - key_s)* time_step;
vec_player_movement[1] = player_speed * (key_a - key_d)* time_step;
     			
c_move(me,vec_player_movement,nullvector,GLIDE);
vec_set (camera.x,player.x);
camera.z += player_eye_height;
	
wait(1);
}
}


Enjoy...

Last edited by DJBMASTER; 11/06/08 21:32.
Re: Moving in direction [Re: DJBMASTER] #235372
11/07/08 11:48
11/07/08 11:48
Joined: Sep 2008
Posts: 13
Croatia
ponco123 Offline OP
Newbie
ponco123  Offline OP
Newbie

Joined: Sep 2008
Posts: 13
Croatia
Thanks!


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