Making my own physics engine (need help sorta)

Discussion in 'Physics & Math' started by gamelord, Jun 24, 2018.

  1. TheFrogger Registered Senior Member

    You'd have to program the physics of gravity and velocity i.e. life on Earth etc. into the computer and then run the program. ☺
  2. Google AdSense Guest Advertisement

    to hide all adverts.
  3. gamelord Registered Senior Member

    Ok I did this. The rotations produced by the cross product seemed off, so I just ran a bunch of Physics based box2d sims of a cube, and saved the data of each test run.

    The numbers output by the cross product do not seem to match the graph output by the box2d cube.
    I also rendered them on top each other and they still do not match.
    What I mean by this is I overlayed the cross-product physics on top of a realistic physics engine and it does not match the ratios. For example, I got the ratio of rotations, when the custom box hit at a certain angle, 30 degrees, and cross referenced it to the realistic physics of a box hitting at 30 degrees. The ratio was 2.38. So I multiplied this to it and then changed the angle, but the ratio did not stay the same. Each new angle produced a new ratio and the cross product graph did not match the graph of the realistic physics.
    Here is the data of the realistic physics, tested on a square colliding with a rectangle, vertical speed -2, horizontal speed 0,:
    angle: richochetspeed angular velocity
    -7.5: -.11 105.10
    -15: .28 104.22
    -22: .77 97.07
    -30: 1.33 78.79
    -37.5: 1.80 45
    -45: 2 0

    If that is confusing, basically to simplify: the graph of the realistic physics looks kind of funky and exponential. The rotation speed doesnt increase linearly in relation to the angle. It would be nice if there was some kind of formula analysis to give me the equation behind this.

    I did not take the time to record all of the data for the homebrew physics, only do some overlay testing and it did not match.

    I don't have Microsoft Excel so if someone could direct me to a graph display app that would be nice.
    Also, if someone could point out a formula analyzer that would be nice, some kind of program that analyzes data and patterns.
    Yes I noticed this but this kind of seems like on the phlebotinum side of the spectrum. I noticed that the linear richochet velocity should lose energy based on the rotational speed. But I dont know the exact equation to determine the linear ricochet velocity and rotational velocity, in regards to the cross product. If there was an exact equation it would be nice.
  4. Google AdSense Guest Advertisement

    to hide all adverts.

Share This Page