Gamestudio Links
Zorro Links
Newest Posts
Executing Trades on Next Bar Open
by vicknick. 06/13/24 08:51
Zorro Beta 2.61: PyTorch
by jcl. 06/10/24 14:42
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 1,295 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19059 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
How to measure rpm of an object? #351197
12/22/10 17:30
12/22/10 17:30
Joined: Sep 2010
Posts: 82
P
peteredlin Offline OP
Junior Member
peteredlin  Offline OP
Junior Member
P

Joined: Sep 2010
Posts: 82
Hello, i cant figure out a good way to measure how much a object rotates around his own axis.

I tryed with reading the object.roll parameter and divide it by 360 but it didn't work out right..

There must be an easy way to do this..

All help is welcome..

Re: How to measure rpm of an object? [Re: peteredlin] #351200
12/22/10 17:53
12/22/10 17:53
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
measure the angle difference between now and the last frame(store in variable)
now you can calculate the rpm with time_step


Visit my site: www.masterq32.de
Re: How to measure rpm of an object? [Re: MasterQ32] #351202
12/22/10 18:15
12/22/10 18:15
Joined: Sep 2010
Posts: 82
P
peteredlin Offline OP
Junior Member
peteredlin  Offline OP
Junior Member
P

Joined: Sep 2010
Posts: 82
Thanks for pointing me in the right direction but can you give me a sample code?

Re: How to measure rpm of an object? [Re: peteredlin] #351205
12/22/10 18:48
12/22/10 18:48
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
Code:
var lastroll = my.roll;
var rpm = 0;
while(1)
{
    rpm = abs(lastroll - my.roll) / time_step;

    //do your movement stuff here

    lastroll = my.roll;
    wait(1);
}




Visit my site: www.masterq32.de
Re: How to measure rpm of an object? [Re: MasterQ32] #351212
12/22/10 19:59
12/22/10 19:59
Joined: Sep 2010
Posts: 82
P
peteredlin Offline OP
Junior Member
peteredlin  Offline OP
Junior Member
P

Joined: Sep 2010
Posts: 82
I tryed but something go's wrong, i use gamestudio A7 and it counts roll from 0 to 180 and then from -180 to 0 again. This is fifferent than what is described in the manuel i use. This is the reason why it didn't work for me.

Now i need to figure out how to fix it.

Re: How to measure rpm of an object? [Re: peteredlin] #351213
12/22/10 20:05
12/22/10 20:05
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
then you have to check if the value jumps from 180 to -180 and calculate your distance


Visit my site: www.masterq32.de
Re: How to measure rpm of an object? [Re: MasterQ32] #351214
12/22/10 20:14
12/22/10 20:14
Joined: Sep 2010
Posts: 82
P
peteredlin Offline OP
Junior Member
peteredlin  Offline OP
Junior Member
P

Joined: Sep 2010
Posts: 82
How can i easy check if the value jumps from '-' to '+' ?

Its my firsttime i program this.

Re: How to measure rpm of an object? [Re: peteredlin] #351218
12/22/10 20:38
12/22/10 20:38
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
some other question:
in which way do you rotate your object?
maybe you can get your rpm without measuring it...


Visit my site: www.masterq32.de
Re: How to measure rpm of an object? [Re: MasterQ32] #351220
12/22/10 20:55
12/22/10 20:55
Joined: Sep 2010
Posts: 82
P
peteredlin Offline OP
Junior Member
peteredlin  Offline OP
Junior Member
P

Joined: Sep 2010
Posts: 82
Well its a car wheel, so i aply the motor torque on the wheels. Then i want to measure the wheel rotation so i know how the motor rpm's are influenced

Re: How to measure rpm of an object? [Re: peteredlin] #351221
12/22/10 21:02
12/22/10 21:02
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
did you create the code yourself or do you use the physic engine?


Visit my site: www.masterq32.de
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