Re: bouncing rectangle



On Mar 19, 12:40 am, b...@xxxxxxxxxxxxxx wrote:
I'm trying to understand computer game physics better, so I'm making a
2d program that features a rectangle bouncing around on the screen and
rotating (no gravity now).

Unfortunately, the rectangle seems to keep gaining energy, and
eventually it goes ridiculously fast. I'm wondering if there is an
error in my basic approach.

Essentially, the edges of the screen are considered walls, so if a
point on the rectangle goes outside an edge, a force and a torque are
applied to the rectangle. The magnitude of the force is essentially
twice the velocity going towards the edge.

This velocity includes the rotational velocity.

For instance, if a point is going at a velocity of 1 to the right
without rotating, and it hits the right edge, the force it gets is 2
in the opposite direction.

If the point is rotating, I try to add w x r (cross product of angular
velocity and radius vector). So, for the aforementioned point, I would
add the x component of w x r, and the force it gets is (2 * (1 + (x
component of w x r))).

(BTW, I'm just assuming mass=1 for the rectangle for simplicity.)

Anyone see an error in this approach?

Yes.
In an elastic collision between a wall and a *non-rotating* object,
the outgoing perpendicular velocity will be the same as, but opposite
to, the incoming perpendicular velocity, which is where I think your
statement that the *change* in velocity (what you call a "force) is
twice the velocity.
However, for an object that *rotates*, this condition no longer
applies, as some of that linear kinetic energy can become rotational
kinetic energy, and so the rebound linear velocity can actually be
much lower than the incoming linear velocity, which you can easily see
with experiments with a superball on a garage floor at home.

PD

.



Relevant Pages

  • Re: bouncing rectangle
    ... Unfortunately, the rectangle seems to keep gaining energy, and ... This velocity includes the rotational velocity. ... in the opposite direction." ... Ball arrives at right side. ...
    (sci.physics)
  • Re: bouncing rectangle
    ... I think you might as well add gravity, because it's easy compared to what you're already trying to do. ... point on the rectangle goes outside an edge, a force and a torque are ... because force and velocity have different units. ... If we assume the force applied by the wall is normal to the wall, then we ought to be able to solve for the correct value, because we have one scalar unknown and one scalar constraint (conservation of energy). ...
    (sci.physics)
  • Re: bouncing rectangle
    ... rotating (no gravity now). ... Unfortunately, the rectangle seems to keep gaining energy, and ... This velocity includes the rotational velocity. ...
    (sci.physics)
  • bouncing rectangle
    ... rotating (no gravity now). ... Unfortunately, the rectangle seems to keep gaining energy, and ... This velocity includes the rotational velocity. ...
    (sci.physics)
  • Re: Are *observed* SR effects real?
    ... The physics cannot depend on velocity ... relative to all possible reference frames, ... for "kinetic energy non-physical" because it is frame dependent? ... that's the standard point of view in physics ...
    (sci.physics.relativity)