|
2 registered members (Grant, AndrewAMD),
911
guests, and 9
spiders. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
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
Expert
|
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
OP
Member
|
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
flits
User
|
User
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: RyuShinji]
#143329
07/26/07 10:36
07/26/07 10:36
|
Joined: Mar 2006
Posts: 3,538 WA, Australia
JibbSmart
Expert
|
Expert
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
OP
Member
|
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
|
Anonymous
Unregistered
|
Anonymous
Unregistered
|
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: RyuShinji]
#143333
07/26/07 12:40
07/26/07 12:40
|
Joined: Mar 2006
Posts: 3,538 WA, Australia
JibbSmart
Expert
|
Expert
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!
|
|
|
|