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
4 registered members (AndrewAMD, TipmyPip, NewbieZorro, Grant), 14,196 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
Problem rotating an entity #189593
03/19/08 22:51
03/19/08 22:51
Joined: Mar 2008
Posts: 7
R
Regrin Offline OP
Newbie
Regrin  Offline OP
Newbie
R

Joined: Mar 2008
Posts: 7
Hello guys. I want to rotate an entity 360º around the Y-axis using his tilt property but it seems to only accept -90..+90 degrees, so I can't to make a full rotation. Do you have idea of how to do this? I'm very noob with Lite-C Programming so any help will be helpfull

Re: Problem rotating an entity [Re: Regrin] #189594
03/20/08 01:12
03/20/08 01:12
Joined: Oct 2003
Posts: 702
Z
zazang Offline
User
zazang  Offline
User
Z

Joined: Oct 2003
Posts: 702
Try using ang_add and ang_rotate for this.


I like good 'views' because they have no 'strings' attached..
Re: Problem rotating an entity [Re: Regrin] #189595
03/20/08 01:26
03/20/08 01:26
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
Quote:

I want to rotate an entity 360º around the Y-axis


Doing this will result in exactly the same position as before..?! Or are you trying to rotate it slowly? Then a loop with a "my->tilt += time_step; wait(1);" inside will do the trick.


Always learn from history, to be sure you make the same mistakes again...
Re: Problem rotating an entity [Re: Regrin] #189596
03/20/08 04:30
03/20/08 04:30
Joined: Mar 2008
Posts: 7
R
Regrin Offline OP
Newbie
Regrin  Offline OP
Newbie
R

Joined: Mar 2008
Posts: 7
I'll give you more details. I'm trying to attach a full helmet into my character's head correctly, even if he permorfs a backflip jump. Here is the code I use in the helmet action:

Code:
while(1)
{
VECTOR vec_nape;
VECTOR vec_nose;
VECTOR vec_dir;
ANGLE temp;

vec_for_vertex(vec_nape,Gnome,750); //nape vertex
vec_for_vertex(vec_nose,Gnome,772); //nose vertex
vec_diff(vec_dir,vec_nose,vec_nape); //face orientation

//sets the helmet direction same as character's head direction
vec_to_angle(my.pan,vec_dir);

//then move the helmet position into character's head position
vec_scale(vec_dir,0.35);
vec_add(vec_dir,vec_nape);
vec_set(my.x,vec_dir.x);

wait(1);
}




It works great at most animations but not at those which the model performs a rotation around the Y-axis. It seems like the helmet isn't able to rotate more than 90º or less than -90º around the Y-axis. Then I read at SED Command Help:

Range:
pan: 0 .. 360
tilt: -90 .. +90
roll: 0 .. 360

But I've tested the action using only the "my->tilt += time_step;" line code and the helmet performs a 360º rotation around the Y-axis, so is tilt range: 0 .. 360? I hope you understand me, I'm kinda lost here

Last edited by Regrin; 03/20/08 05:53.

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