Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
0 registered members (), 938 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Absolute pan, tillt and roll #143324
07/25/07 13:52
07/25/07 13:52
Joined: Nov 2006
Posts: 193
England
RyuShinji Offline OP
Member
RyuShinji  Offline OP
Member

Joined: Nov 2006
Posts: 193
England
I want to be able to roll a crate in all direction the problem is when i tilt it forwards the try and tilt its sideways its roll has change...

Is there a way to pan, tilt & roll a model Absolutey rather than reletivly?

Re: Absolute pan, tillt and roll [Re: RyuShinji] #143325
07/25/07 14:17
07/25/07 14:17
Joined: Mar 2006
Posts: 2,503
SC, United States
xXxGuitar511 Offline
Expert
xXxGuitar511  Offline
Expert

Joined: Mar 2006
Posts: 2,503
SC, United States
Do you mean how to rotate it relativly (I believe the word is arbitrary rotation, IDK).

Rotating absolutely/directly is done by changing pan/tilt/roll

relative rotation is done through things such as ang_rotate()/c_rotate(.., use_axisr);


xXxGuitar511
- Programmer
Re: Absolute pan, tillt and roll [Re: xXxGuitar511] #143326
07/25/07 16:07
07/25/07 16:07
Joined: Nov 2006
Posts: 193
England
RyuShinji Offline OP
Member
RyuShinji  Offline OP
Member

Joined: Nov 2006
Posts: 193
England
i'm not sure which i should use...

i need it to rotate even if its pan, tilt and roll has change..

if i tilt the the crate by +90 and its x + 32 it should tilt forward or down right?

//if i move the crate down
if(crateangle < 90) ///this is some of my code
{
my.tilt += 1.5;
crateangle += 1.5;
my.x += 1;
}
///then after, if i move the crate to the side

if(crateangle < 90) ///note the var "crateangle" is set back to 0;
{
my.roll += 1.5;
crateangle += 1.5;
my.y += 1;
}

///!!! it does a sort of pan rather than a roll and slides along the floor

does anyone know which should i use???

Last edited by RyuShinji; 07/25/07 16:09.
Re: Absolute pan, tillt and roll [Re: RyuShinji] #143327
07/25/07 17:32
07/25/07 17:32
Joined: Jul 2007
Posts: 959
nl
F
flits Offline
User
flits  Offline
User
F

Joined: Jul 2007
Posts: 959
nl
hello

//if he move the crate down
if(crateangle < 90)
{
c_rotate(me, vector(0,1.5*time,0),use_aabb);
crateangle += 1.5;
my.x += 1;
}
///then after, if he move the crate to the side

//crateangle = 0;//note the var "crateangle" is set back to 0;

if(crateangle < 90)
{
c_rotate(me, vector(0,0,1.5*time),use_aabb);
crateangle += 1.5 *time;
my.y += 1 *time;
}

this is the last time that i write this last line besaucause i am getting it in my acc

every help is welcome even the stupid one like mine >><<
i dont know if this works but maby it helps you


"empty"
Re: Absolute pan, tillt and roll [Re: flits] #143328
07/26/07 10:29
07/26/07 10:29
Joined: Nov 2006
Posts: 193
England
RyuShinji Offline OP
Member
RyuShinji  Offline OP
Member

Joined: Nov 2006
Posts: 193
England
Thanks for your help...

But it has not made a difference they still rotate the wrong way, depanding on there rotation,

for instance if I roll the crate left it rolls left, but if I tilt the crate forward and then roll it left, it roll on its side making it apear as if its is paning insted, how can i make it ignore all of its previous rotations???

Re: Absolute pan, tillt and roll [Re: RyuShinji] #143329
07/26/07 10:36
07/26/07 10:36
Joined: Mar 2006
Posts: 3,538
WA, Australia
J
JibbSmart Offline
Expert
JibbSmart  Offline
Expert
J

Joined: Mar 2006
Posts: 3,538
WA, Australia
if you want to rotate an object absolutely, around an absolute axis, you would need to use quaternions (or at least, that's the easiest way). lite-C's the easiest way to do it (check in the User Contributions (Lite-C Section) if you start using it) but even then it's still a little complicated.

someone has done a demonstration of quaternions in C-script, and it's probably under the other User Contributions forum if you do a search. it's a lot more complicated though.

julz


Formerly known as JulzMighty.
I made KarBOOM!
Re: Absolute pan, tillt and roll [Re: JibbSmart] #143330
07/26/07 11:21
07/26/07 11:21
Joined: Nov 2006
Posts: 193
England
RyuShinji Offline OP
Member
RyuShinji  Offline OP
Member

Joined: Nov 2006
Posts: 193
England
Thanks for your help I'm sure that would or but its a bit too comlicated for me i may have to resort to it in the end though...

but what if i use vec_rotate to let the rotation depend on xyz, would that work?
because i just want it ro rotate in the direction its moving...

ive tried myself but it might just me my error that stops it from working..

Last edited by RyuShinji; 07/26/07 11:23.
Re: Absolute pan, tillt and roll [Re: RyuShinji] #143331
07/26/07 11:25
07/26/07 11:25

A
Anonymous
Unregistered
Anonymous
Unregistered
A



try something like this:

Code:
 
vec_set(my.skill30,vector(0,0,0));
my.skill30 = 2*(key_q - key_w);
my.skill31 = 2*(key_a - key_s);
my.skill32 = 2*(key_y - key_x);
ang_add(my.skill30,my.pan);
vec_set(my.pan,my.skill30);



Re: Absolute pan, tillt and roll [Re: ] #143332
07/26/07 12:34
07/26/07 12:34
Joined: Nov 2006
Posts: 193
England
RyuShinji Offline OP
Member
RyuShinji  Offline OP
Member

Joined: Nov 2006
Posts: 193
England
Thanks, but it still tends rotates depending on its pan, tilt and roll values.

what about changing its defult angles every time it moves...

or what if i give my modle frames that show it set at every possible angle

rotate;
change frame;
set all angle to 0;

that should work shouldn't it?

Re: Absolute pan, tillt and roll [Re: RyuShinji] #143333
07/26/07 12:40
07/26/07 12:40
Joined: Mar 2006
Posts: 3,538
WA, Australia
J
JibbSmart Offline
Expert
JibbSmart  Offline
Expert
J

Joined: Mar 2006
Posts: 3,538
WA, Australia
maybe you could do it with bones?

look in the manual about bones functions. it could be helpful.

i don't know anything about a6/a7 bones, so i can't be more specific.

julz


Formerly known as JulzMighty.
I made KarBOOM!
Page 1 of 2 1 2

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