Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, Ayumi), 1,405 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Bobbing in water motion #442368
06/19/14 17:49
06/19/14 17:49
Joined: Mar 2003
Posts: 1,524
Canada
Stansmedia Offline OP
Serious User
Stansmedia  Offline OP
Serious User

Joined: Mar 2003
Posts: 1,524
Canada
Does anybody know of a good way to create a bobbing in water motion? Like just a subtle Z/tilt/roll motion. I would imagine its some kind of sin formula but I've never wrapped my head around that stuff.


Decessus - 80% done. 100% abandoned.
GET MY ANDROID GAME! https://play.google.com/store/apps/details?id=com.lasertrain.zspinballfree&hl=en
Re: Bobbing in water motion [Re: Stansmedia] #442371
06/19/14 18:22
06/19/14 18:22
Joined: May 2014
Posts: 179
The lit part of the Truth
C
CyberGhost Offline
Member
CyberGhost  Offline
Member
C

Joined: May 2014
Posts: 179
The lit part of the Truth
There is something like that in the AUM, but I think it's a bit sharp and slow ...


Nothing to say ....
Re: Bobbing in water motion [Re: Stansmedia] #442372
06/19/14 18:24
06/19/14 18:24
Joined: Mar 2003
Posts: 1,524
Canada
Stansmedia Offline OP
Serious User
Stansmedia  Offline OP
Serious User

Joined: Mar 2003
Posts: 1,524
Canada
Well. If I knew how to use the search feature, this thread would not exist. Heres the code I whipped up:

You'll never guess who's thread response helped me solve this. I'll give you a hint: The name starts with S and rhymes with uperku

Code:
action bobinwater()
{
	set(my,PASSABLE);
	VECTOR origin;
	vec_set(origin,my.x);
	ANGLE organg;
	organg.tilt = my.tilt;
	organg.roll = my.roll;
	var bob;
	while(1)
	{
		bob += time_step*5;
		bob %= 360;
		my.z = origin.z-sinv(bob);
		my.roll = organg.roll+12*sinv(bob+90);
		my.tilt = organg.tilt+5*sinv(bob);
		my.pan += time_step*0.1;
		wait(1);
	}	
	
}



Decessus - 80% done. 100% abandoned.
GET MY ANDROID GAME! https://play.google.com/store/apps/details?id=com.lasertrain.zspinballfree&hl=en
Re: Bobbing in water motion [Re: Stansmedia] #442373
06/19/14 19:47
06/19/14 19:47
Joined: May 2014
Posts: 179
The lit part of the Truth
C
CyberGhost Offline
Member
CyberGhost  Offline
Member
C

Joined: May 2014
Posts: 179
The lit part of the Truth
LOL laugh

Last edited by CyberGhost; 06/19/14 19:54.

Nothing to say ....
Re: Bobbing in water motion [Re: CyberGhost] #442819
07/03/14 21:10
07/03/14 21:10
Joined: Mar 2012
Posts: 927
cyberspace
W
Wjbender Offline
User
Wjbender  Offline
User
W

Joined: Mar 2012
Posts: 927
cyberspace
you could also create a sinking / float action by
turning off gravity or making the object massless
when the object is beneath the
water hight (after sinking a bit), when its beneath some limit or for some time you then apply
a small upward force to the object , when the
object reaches above a certain hight you again
switch off gravity ...

this will also alow your object to rotate around
more freely like an outer space environment. .


Compulsive compiler

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

Gamestudio download | chip programmers | 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