[ Solved ][Xors3D] Need help with car wheel.

BlitzMax Forums/BlitzMax Programming/[ Solved ][Xors3D] Need help with car wheel.

Yue(Posted 2016) [#1]


I do not know how to prevent the tires from jumping, I thought I had solved the problem, but no, this continues.

Any Suggestions?


Start Program.


Type Camera.



Derron(Posted 2016) [#2]
Don't know if "xKey" contains your personal serial (I do not use xors3d). If it is your personal serial, you should better remove it.


Regarding your problem: Sorry, cannot help you on this.


bye
Ron


Derron(Posted 2016) [#3]
Maybe rename the thread to something with more expression.


"[XORS3D] Need help with car wheel behaviour / suspension"


Bye
Ron


Yue(Posted 2016) [#4]
One of the problems to learn is that I do not speak English, the documentation does not tell me anything important to me, so the only thing I have left is proof and error, in the end this tires me a lot, since I wear myself looking for a solution on it.

What I have noticed is that if the object that follows the camera is not a vehicle, to solve the problem I have to put the position and movement between xUpdateWorld and RenderWorld, however this does not work with a vehicle that has four wheels hooked. I have come to think that it is an Xors3D bug, although I do not like to think that I am the one who does not know how to do things. I will continue to try, in the end this is like sneaking into a tomb in egypt and deciphering the hieroglyphs of a king of the past. :(


grable(Posted 2016) [#5]
Is it when the wheels are on the ground or when they are in the air?

They look a tad jerky on the ground but its not that terrible, in the air on the other hand they seems to never stop moving.

In both cases some damping would help, although it would make the movement slower.
I dont know xors3d, but most physics engines have some sort of setting for this, either per object/link or as a whole.

EDIT: After some searching, it appears to use PhysX which has some settings for this, though i dont know how much of it is exposed to xors3d.


Yue(Posted 2016) [#6]
@Grable Hi,


These are the commands to configure the aspects of the tires, I can not fully understand them, I try and error, but I can not find a correct configuration.


My code for Config Wheels.
   For Local  i:Byte = 0 To xEntityCountWheels(Self.chassis.malla:Int) - 1
			
		
		'xEntityWheelSetRadius(chassis, i, 1.0)
		Rem 
		
		xEntityWheelSetSuspensionLength(Self.chassis.malla:Int, i, 1.5)
		xEntityWheelSetSuspensionStiffness(Self.chassis.malla:Int, i, 3.8)
		xEntityWheelSetSuspensionDamping(Self.chassis.malla:Int, i, 0.22)
		xEntityWheelSetSuspensionCompression(Self.chassis.malla:Int, i, 0.3)
		xEntityWheelSetFriction(Self.chassis.malla:Int, i, 1000)
		xEntityWheelSetRollInfluence(Self.chassis.malla:Int, i, 0.18)
EndRem 
		
		
			xEntityWheelSetMaxSuspensionForce(Self.chassis.malla:Int, i, 6000*5.0)
	
			
		Next




Any help to set this up correctly, I greatly appreciate it.


grable(Posted 2016) [#7]
From the looks of that API, xors3d has implemented its own wheel+suspension system using primitives of the underlying physics engine, which makes this harder.
Those values look like magic numbers to me though, i wouldnt know what is appropriate :/

You would have to play with suspension Stiffness+Compression+Damping to get a feel for the values really, and that wheel Friction at 1000 seems a tad high maybe?
Also the MaxSuspensionForce seems very large, it might get too much force into the spring which it is unable to dampen.

I would set up a testbed with 1 suspension and 1 wheel and measure the different values on impacts of varying force, print all the values and probably throw in a graph or two to see whats what.

Sorry i cant be more helpful, without knowing the specifics of the physics engine its hard to reason about as they all behave differently.


Yue(Posted 2016) [#8]
Hello, I have done many tests about it. The value of EntityWheelSetMaxSuspensionForce is high because it is related to the mass of the chassis, which is 2000 kilos and if I put it very low, the weight beats the shock absorbers.

The end of all this is that I think there is an error inside Xors3D, I can not find another answer.

But what I've discovered is that if I turn off vertical sync, and I use xWorldSetFrequency (850) and the new value of 850 it all improves drastically. Although the default value is 60, and this influences the rendering of physics. Now the question is, does it only work here? Will it be able to work properly on another computer?


Uploading Video...


Yue(Posted 2016) [#9]
Here video.




Yue(Posted 2016) [#10]
Ok,

My monitor is an old one, and the sampling rate goes to 85, just like the fps, here I establish that the frequency of physics equals the number of frames per second. I think the error goes here.
	xWorldSetFrequency(xGetFPS())



Derron(Posted 2016) [#11]
You should not need to limit physics frequency to the render rate.

higher physics rate means "smaller steps". The famous "bullet" example is that for big steps, it might misses to hit the body.
step 1 (at 0:00:01.0): it is 1cm before the wall
step 2 (at 0:00:01.5: it is 1cm after the wall

with smaller steps (higher physics frequency)
step 1 (at 0:00:01.0): it is 1cm before the wall
step 2 (at 0:00:01.1): it is hitting the wall
step 3 (at 0:00:01.2): it is hitting the wall
step 4 (at 0:00:01.3): it is hitting the wall
step 5 (at 0:00:01.4): it is leaving the wall
step 5 (at 0:00:01.4): it is 1cm after the wall


Hope this explains it "good enough".


bye
Ron


Yue(Posted 2016) [#12]
Ok, here new Video.



The tires keep shaking, I do not understand why, but they do less.


Yue(Posted 2016) [#13]
Ok, Solved :)