Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/05/23 10:32
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
6 registered members (AndrewAMD, alibaba, fairtrader, ozgur, TipmyPip, Quad), 604 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
rotation problem #77290
06/10/06 16:09
06/10/06 16:09
Joined: Apr 2006
Posts: 265
V
vartan_s Offline OP
Member
vartan_s  Offline OP
Member
V

Joined: Apr 2006
Posts: 265
I have a small problem. Say I want something to continuosly rotate, but on an axis, like the earth rotates on a tilt of about 23 degrees, how would I do this? It doesn't work with just c_rotate or changing pan and tilt - its rotations are wrong.

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 Offline
Expert
xXxGuitar511  Offline
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: xXxGuitar511] #77292
06/10/06 19:05
06/10/06 19:05
Joined: Apr 2006
Posts: 265
V
vartan_s Offline OP
Member
vartan_s  Offline OP
Member
V

Joined: Apr 2006
Posts: 265
I've tried it with ang_add, but I can't do it... the manual is a bit vague.

Any way you could demonstrate? say with earth: set pan to skill4, its tilt is skill5.

How would you do that?

Re: rotation problem [Re: vartan_s] #77293
06/10/06 19:34
06/10/06 19:34
Joined: Apr 2005
Posts: 2,332
Germany, BaWü
aztec Offline

Expert
aztec  Offline

Expert

Joined: Apr 2005
Posts: 2,332
Germany, BaWü
heres a simple action how to rotate an object
maybe u can use it if it is to fast for you just play with the settigns
Code:
action drehen
{
while (my.skill1 ==1)
{

my.pan +=3;
wait(1);
}
}




Visit:
schwenkschuster-design.de
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 Offline
Expert
xXxGuitar511  Offline
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] #77295
06/10/06 22:31
06/10/06 22:31
Joined: Oct 2003
Posts: 246
A
Alberto Offline
Member
Alberto  Offline
Member
A

Joined: Oct 2003
Posts: 246
in 6.4.05 there is a flag you can set in c_rotate that does this effect.


What is it exactly ?

Re: rotation problem [Re: Alberto] #77296
06/10/06 22:33
06/10/06 22:33
Joined: Mar 2006
Posts: 2,503
SC, United States
xXxGuitar511 Offline
Expert
xXxGuitar511  Offline
Expert

Joined: Mar 2006
Posts: 2,503
SC, United States
in Way 3 above....

I used USE_AXISR....


That's the flag.....


xXxGuitar511
- Programmer
Re: rotation problem [Re: xXxGuitar511] #77297
06/11/06 12:22
06/11/06 12:22
Joined: Apr 2006
Posts: 265
V
vartan_s Offline OP
Member
vartan_s  Offline OP
Member
V

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 Offline
Expert
xXxGuitar511  Offline
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
Re: rotation problem [Re: xXxGuitar511] #77299
06/12/06 13:43
06/12/06 13:43
Joined: Apr 2006
Posts: 265
V
vartan_s Offline OP
Member
vartan_s  Offline OP
Member
V

Joined: Apr 2006
Posts: 265
But what if my code requires that my WED angles are not changed? I need to do a bit of relative movement first. And there's no way I can move this into the absolute part of c_move because it has a slight inaccuracy (i think to do with rounding) that causes my objects to make slight vibrations out of their course.

Any ideas?

Page 1 of 2 1 2

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