Angular and Rectilinear Acceleration checking

Everything related to 3D programming
User avatar
Psychophanta
Addict
Addict
Posts: 4976
Joined: Wed Jun 11, 2003 9:33 pm
Location: Lípetsk, Russian Federation
Contact:

Angular and Rectilinear Acceleration checking

Post by Psychophanta »

As long as I know, today there is no way to achieve the Rectilinear (nor angular) acceleration of the mass center of a body.
I know, we can get its acceleration per tick (program loop), checking its instantaneous velocity in a loop, and then check it again for the next loop, and then substracting the current one from the previous one.

However, same as in the real world, a "static" body supported onto a surface, experiments an acceleration (which is reported by any acceleration sensor) which points colinear to the gravity flux; and, aparently, it is not moving to any direction.

So, is there any trick or so to "install" an accelerometer (acceleration sensor) to a EntityBody?
I mean, is there any way to know the acceleration which a body is experimenting?

Thanks in advance for your reading. :)
http://www.zeitgeistmovie.com

While world=business:world+mafia:Wend
Will never leave this forum until the absolute bugfree PB :mrgreen:
User avatar
DK_PETER
Addict
Addict
Posts: 898
Joined: Sat Feb 19, 2011 10:06 am
Location: Denmark
Contact:

Re: Angular and Rectilinear Acceleration checking

Post by DK_PETER »

You can get the LinearVelocity and AngularVelocity using...
https://www.purebasic.com/documentation ... ibute.html
Edit: Forgot to add..
You need to calculate the acceleration using the velocity values yourself.
Current configurations:
Ubuntu 20.04/64 bit - Window 10 64 bit
Intel 6800K, GeForce Gtx 1060, 32 gb ram.
Amd Ryzen 9 5950X, GeForce 3070, 128 gb ram.
User avatar
Psychophanta
Addict
Addict
Posts: 4976
Joined: Wed Jun 11, 2003 9:33 pm
Location: Lípetsk, Russian Federation
Contact:

Re: Angular and Rectilinear Acceleration checking

Post by Psychophanta »

DK_PETER wrote:You can get the LinearVelocity and AngularVelocity using...
https://www.purebasic.com/documentation ... ibute.html
Edit: Forgot to add..
You need to calculate the acceleration using the velocity values yourself.
Yes dear, I already know that way. And it is what i am implementing. However, as stated, that way does not allow to know the gravity acceleration with experiments a body which is stored onto a flat floor, for example.
That's way my question and request for a #AngularAcceleration and #LinearAcceleration flags.
http://www.zeitgeistmovie.com

While world=business:world+mafia:Wend
Will never leave this forum until the absolute bugfree PB :mrgreen:
User avatar
DK_PETER
Addict
Addict
Posts: 898
Joined: Sat Feb 19, 2011 10:06 am
Location: Denmark
Contact:

Re: Angular and Rectilinear Acceleration checking

Post by DK_PETER »

Which is why, I wrote it as a confirmation to your question.
There is, at present, not any other way to do it. :wink:
But you could add it to the request and wishlist..
Current configurations:
Ubuntu 20.04/64 bit - Window 10 64 bit
Intel 6800K, GeForce Gtx 1060, 32 gb ram.
Amd Ryzen 9 5950X, GeForce 3070, 128 gb ram.
User avatar
Psychophanta
Addict
Addict
Posts: 4976
Joined: Wed Jun 11, 2003 9:33 pm
Location: Lípetsk, Russian Federation
Contact:

Re: Angular and Rectilinear Acceleration checking

Post by Psychophanta »

Yes, thanks, but requesting almost never works :( :)
http://www.zeitgeistmovie.com

While world=business:world+mafia:Wend
Will never leave this forum until the absolute bugfree PB :mrgreen:
marc_256
Enthusiast
Enthusiast
Posts: 743
Joined: Thu May 06, 2010 10:16 am
Location: Belgium
Contact:

Re: Angular and Rectilinear Acceleration checking

Post by marc_256 »

Hallo Psychophanta,

- Do you want to read an real world accelerometer (acceleration sensor) ?
We (me and my daughter) are using it with arduino, and you can read the XYZ from the accelerometer via serial communication.

- If it is only in 3D game program software,
this is very simple if your object is not moving (static body)
X = 0.0
Y = 0.0
Z or gravity = 9.81 m/s2
but once, your objects is moving (dynamic body) this becomes very difficult.
You need to calculate/compare the old motion speed data with the new one in XYZ directions and rotations.
And delta linear acc XYZ and rotations must be calculated with the old and new speed, rotations and the time difference.
If your object is jumping from a height, gravity can be 0, or even negative ...
If your object is falling freely it will increase by about 9.81 meters per second every second...

I used this a long time ago, will see if I can find some info of my old program,
it must be stored on an old backup HDD somewhere.

Sorry if I did not understand your question very well.

marc,
- every professional was once an amateur - greetings from Pajottenland - Belgium -
PS: sorry for my english I speak flemish ...
User avatar
Psychophanta
Addict
Addict
Posts: 4976
Joined: Wed Jun 11, 2003 9:33 pm
Location: Lípetsk, Russian Federation
Contact:

Re: Angular and Rectilinear Acceleration checking

Post by Psychophanta »

Hello Marc.

Yes, indeed you understood my question, and in 2016 i made several prototypes with the accelerometer well known MPU6050, or similars, which are extraordinary. In the 2001 I used ST and PIC micros, with industrial accelerometers from "Sensorex", and it was worse than MPU6050.
In 2016, with the MPU6050 and PB, I performed some tips to see in screen a cube and move it , and rotate it while i move and rotate the physical accelerometer.
This device just returns 2 vectors (6 scalar variables), one of them is the rectilinear acceleration and the other , the angular acceleration. Of course, relative to the chip itself.

Since i have other works on my desk for other stuff, I had to left this, but really is so interesting.
I am just trying to simulate my algos first with PB in 3D than plug an arduino and try. And this way is useful , upto certain point.
http://www.zeitgeistmovie.com

While world=business:world+mafia:Wend
Will never leave this forum until the absolute bugfree PB :mrgreen:
User avatar
Olliv
Enthusiast
Enthusiast
Posts: 542
Joined: Tue Sep 22, 2009 10:41 pm

Re: Angular and Rectilinear Acceleration checking

Post by Olliv »

Hello Psychophanta,

I doudt that the native velocity functions are already realistic... If yes, then the acceleration features should be added.
Post Reply