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
2 registered members (TipmyPip, AndrewAMD), 14,136 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
ease-in and ease-out? #128777
05/09/07 00:42
05/09/07 00:42
Joined: Dec 2003
Posts: 61
miami
gunplay Offline OP
Junior Member
gunplay  Offline OP
Junior Member

Joined: Dec 2003
Posts: 61
miami
are there any example scripts of moving an entiy or camera with an ease-in and out.

Re: ease-in and ease-out? [Re: gunplay] #128778
05/09/07 01:00
05/09/07 01:00
Joined: Mar 2007
Posts: 69
L
luke_was_ere Offline
Junior Member
luke_was_ere  Offline
Junior Member
L

Joined: Mar 2007
Posts: 69
by this do you mean acceleration of speed? Or do you mean ease-in in terms of visibility on screen?

Re: ease-in and ease-out? [Re: luke_was_ere] #128779
05/09/07 15:04
05/09/07 15:04
Joined: Dec 2003
Posts: 61
miami
gunplay Offline OP
Junior Member
gunplay  Offline OP
Junior Member

Joined: Dec 2003
Posts: 61
miami
acceleration of speed. basically i want to click on an object and have it move from point A to point B without an abrupt start or stop. a gradual increase in speed then a gradual decrease so the motion doesn't appear jerky

thanx in advance

Re: ease-in and ease-out? [Re: gunplay] #128780
05/09/07 15:43
05/09/07 15:43
Joined: Mar 2007
Posts: 69
L
luke_was_ere Offline
Junior Member
luke_was_ere  Offline
Junior Member
L

Joined: Mar 2007
Posts: 69
not sure of the syntax but id say you'd want a variable that increments by say power of 2 to get the speed to go up. e.g 0= stationary 100= fast moving,

1 x2 =2
2 x 2 =4
4 x 2 =8
8 x 2 =16 etc...

so like x *=2


and then maybe get it to follow a path, as to a template im not sure really, sorry i cant be more specific, im new to coding in 3DGS

Re: ease-in and ease-out? [Re: luke_was_ere] #128781
05/09/07 16:06
05/09/07 16:06
Joined: Mar 2007
Posts: 776
Poor village - Poland ;)
tompo Offline
User
tompo  Offline
User

Joined: Mar 2007
Posts: 776
Poor village - Poland ;)
Code:
 
define speed,skill10;
define speed_max,skill11;
var distance;
action player
{
my.speed_max = 10;
while(1)
{
distance = vec_dist(my.x, B.x);
if(distance > 100)
{
if(my.speed < my.speed_max){my.speed += 2 * time_step;}
}
else
{
if(my.speed >0){my.speed -= 2 * time_step;}
}
if(distance <=0){my.speed = 0;}
vec_set(temp,B.x);
vec_sub(temp,my.x);
vec_to_angle(my.pan,temp);
c_move(me,vector(my.speed *time_step,0,0),nullvector,GLIDE);
wait(1);
}
}



Play with distance and speed to avoid stoping player before he reach the target

Last edited by tompo; 05/09/07 16:12.

Never say never.
Re: ease-in and ease-out? [Re: tompo] #128782
05/09/07 16:28
05/09/07 16:28
Joined: Dec 2003
Posts: 61
miami
gunplay Offline OP
Junior Member
gunplay  Offline OP
Junior Member

Joined: Dec 2003
Posts: 61
miami
thanx for the help, now if i wanted to use an ease-out with a camera (click a button and the camera animates to point B with an ease out) would it be the same setup?

Re: ease-in and ease-out? [Re: gunplay] #128783
05/09/07 17:06
05/09/07 17:06
Joined: Mar 2007
Posts: 776
Poor village - Poland ;)
tompo Offline
User
tompo  Offline
User

Joined: Mar 2007
Posts: 776
Poor village - Poland ;)
sure... change my.x to camera.x


Never say never.

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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