Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 927 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 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