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
1 registered members (TipmyPip), 18,388 guests, and 6 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
Combined bone and vertex animations #291109
09/23/09 13:14
09/23/09 13:14
Joined: Apr 2009
Posts: 248
Philippines
seecah Offline OP
Member
seecah  Offline OP
Member

Joined: Apr 2009
Posts: 248
Philippines
Hi All,

Can we combine both bone animation and vertex animation inside a loop?

I provided the code snippet but as what I've noticed, it's only the vertex animation that works but the bone animations don't.. I try to read the manual on this but fails for many tries..

Assumes all variables used are already defined..
Code:
void	catcher_animate()
{
	//controls the speed of the propeller animation - bones
	my._propellerspeed = speed_percentage * 100;
	ent_bonerotate(my, anim_LeftTurbine, vector(my._propellerspeed, 0, 0));
	ent_bonerotate(my, anim_RightTurbine, vector(my._propellerspeed, 0, 0));
	
	//controls the turning angle of the submarine - vertex animation
	// I need to handle animation turn here since I don't need a full turning
	my._angleturn = 30*steering_percentage;	//there are 30 animation frames in turning the submarine
	if (my._angleturn < 0) { ent_animate(me, "TurnLeft", my._angleturn, ANM_CYCLE); } //turn left -value
	else { ent_animate(me, "TurnRight", my._angleturn, ANM_CYCLE); } //turn right - value
}



Edited: This function is called inside a while loop..

How can I let the 2 animations run simultaneously??

Please advise..

Last edited by seecah; 09/23/09 13:17.


Can't is not an option™
Re: Combined bone and vertex animations [Re: seecah] #291239
09/24/09 03:00
09/24/09 03:00
Joined: Apr 2009
Posts: 248
Philippines
seecah Offline OP
Member
seecah  Offline OP
Member

Joined: Apr 2009
Posts: 248
Philippines
Anyone please????



Can't is not an option™
Re: Combined bone and vertex animations [Re: seecah] #291250
09/24/09 06:59
09/24/09 06:59
Joined: Aug 2008
Posts: 482
B
bart_the_13th Offline
Senior Member
bart_the_13th  Offline
Senior Member
B

Joined: Aug 2008
Posts: 482
I never tried anything like that, but this is only my guess. Maybe you should rotate the bone AFTER you use animate using vertex animation.
Beside that, I don't see anything wrong with your code, what's the result of your code anyway, if I may ask? laugh

Re: Combined bone and vertex animations [Re: bart_the_13th] #291414
09/25/09 06:01
09/25/09 06:01
Joined: Apr 2009
Posts: 248
Philippines
seecah Offline OP
Member
seecah  Offline OP
Member

Joined: Apr 2009
Posts: 248
Philippines
Sure, the result is that the vertex animation will prevail, I can't see any movement from the bones animation.. But I'm pretty sure that my bone animation should also work since I've tried to comment the vertex animation and it worked..



Can't is not an option™
Re: Combined bone and vertex animations [Re: seecah] #291552
09/26/09 12:20
09/26/09 12:20
Joined: Aug 2008
Posts: 482
B
bart_the_13th Offline
Senior Member
bart_the_13th  Offline
Senior Member
B

Joined: Aug 2008
Posts: 482
Quote form the manual, ent_animate
Quote:

percent : Animation percentage within the scene, 0..100. At 0 the first frame is selected, at 100 the last frame (which is identical with the first for cyclic animation).


It seems that when you turn left, your my.angleturn value is < 0, the manual says that the ent_animate percent range from 0 to 100. Maybe that's the problem. How about using abs(my.angleturn) like:
Code:
...
	if (my._angleturn < 0) { ent_animate(me, "TurnLeft", abs(my._angleturn), ANM_CYCLE); } //turn left -value
	else { ent_animate(me, "TurnRight", my._angleturn, ANM_CYCLE); } //turn right - value
...



or

Code:
...
	if (my._angleturn < 0) { ent_animate(me, "TurnLeft", 100-my._angleturn, ANM_CYCLE); } //turn left -value
	else { ent_animate(me, "TurnRight", my._angleturn, ANM_CYCLE); } //turn right - value
...



Re: Combined bone and vertex animations [Re: bart_the_13th] #291833
09/28/09 12:17
09/28/09 12:17
Joined: Apr 2009
Posts: 248
Philippines
seecah Offline OP
Member
seecah  Offline OP
Member

Joined: Apr 2009
Posts: 248
Philippines
I've tried but it still doesn't work..



Can't is not an option™

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