|
|
Re: rotation problem
[Re: vartan_s]
#77291
06/10/06 16:19
06/10/06 16:19
|
Joined: Mar 2006
Posts: 2,503 SC, United States
xXxGuitar511
Expert
|
Expert
Joined: Mar 2006
Posts: 2,503
SC, United States
|
look up ang_rotate and ang_add in the manual...
+ in 6.4.05 there is a flag you can set in c_rotate that does this effect.
xXxGuitar511 - Programmer
|
|
|
Re: rotation problem
[Re: aztec]
#77294
06/10/06 22:26
06/10/06 22:26
|
Joined: Mar 2006
Posts: 2,503 SC, United States
xXxGuitar511
Expert
|
Expert
Joined: Mar 2006
Posts: 2,503
SC, United States
|
@Star_fox: Dude, read the post next time.  . He wants the model to rotate arbitrarily, not by world angles. @Vartan_s: Yes, the manual is very vague with the ang_add/rotate functions. I had to post in the forum to find out how they worked. Sorry I did not post an example last night, I was too tired and did not feel like digging out my code. (Because I honestly don't remember how it works). ;D Try this: Code:
define PanSpeed, skill1; define TiltSpeed, skill2; define RollSpeed, skill3;
// First Way: // Simply rotates the model along an arbitrary axis... // uses: PanSpeed, TiltSpeed, RollSpeed ACTION RotateMe1 { while(1) { vec_set(temp, vector(my.skill1, my.skill2, my.skill3)); vec_scale(temp, time); ang_add(temp, my.pan); vec_sub(temp, my.pan); c_rotate(my, temp, ignore_passable | ignore_passents); wait(1); } }
// Way 2: // Same as first, but uses c_rotate to check for collision... // uses: PanSpeed, TiltSpeed, RollSpeed ACTION RotateMe2 { while(1) { vec_set(temp, vector(my.skill1, my.skill2, my.skill3)); vec_scale(temp, time); ang_add(temp, my.pan); vec_sub(temp, my.pan); c_rotate(my, temp, ignore_passable | ignore_passents); wait(1); } }
// Way 3: // UNTESTED: Same as way 1 & 2, but much simpler... // uses: PanSpeed, TiltSpeed, RollSpeed ACTION RotateMe3 { while(1) { vec_set(temp, vector(my.skill1, my.skill2, my.skill3)); vec_scale(temp, time); c_rotate(my, temp, ignore_passable | ignore_passents | USE_AXISR); wait(1); } }
Last edited by xXxGuitar511; 06/10/06 22:33.
xXxGuitar511 - Programmer
|
|
|
Re: rotation problem
[Re: xXxGuitar511]
#77297
06/11/06 12:22
06/11/06 12:22
|
Joined: Apr 2006
Posts: 265
vartan_s
OP
Member
|
OP
Member
Joined: Apr 2006
Posts: 265
|
Nice code but theres a problem. It doesn't work, and I'm guessing it's because we're increasing tilt every time as well.... what if I want the tilt not to change but still to be at an angle? And also, I would prefer if instead of rotating the angle, I could just make my.pan equal that angle. Thanks in advance.
Edit: I have fixed this, although there is still a problem, it is rotating as normal
Last edited by vartan_s; 06/11/06 13:50.
|
|
|
Re: rotation problem
[Re: vartan_s]
#77298
06/11/06 17:25
06/11/06 17:25
|
Joined: Mar 2006
Posts: 2,503 SC, United States
xXxGuitar511
Expert
|
Expert
Joined: Mar 2006
Posts: 2,503
SC, United States
|
Actually, the code works perfectly. I have just tested out all three ways, and they work perfect. Quote:
and I'm guessing it's because we're increasing tilt every time as well
WTF? Who's increasing tilt every time? No one said anything about increasing the tilt every "frame".
also, it is not doing the normal pan/tilt/rotate unless you are doing something wrong. Way 1 & 2 will work, but way #3 requires the latest version (6.4.05). Simly orient your model in WED, to the angles you want it to rotate from, the set the 3 Pan/Tilt/Roll speed skills in WED to the angles you want it to rotate on...
ex: The earth... Put the model in a level. Tilt/Roll the model a slight bit. Set the action to any of the three ways above. Set the PanSpeed to a number. Lets use 0.5;
And thats it....
xXxGuitar511 - Programmer
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|