Frisbee

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
ultimateCoder
Posts: 2
Joined: Tue Jul 24, 2012 11:31 pm

Frisbee

Post by ultimateCoder »

Hey, what would be the best way to implement the forces required to simulate a frisbee? I need to be able to throw the frisbee in my game and it have the predictable path a frisbee is known for, as well as function realistically when the frisbee is thrown poorly or is rolling on the ground, etc. Thanks!
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Frisbee

Post by Norbo »

The exact physics behind the behavior of a frisbee are a bit tricky- there's not a simple equation (that I'm aware of) to refer to like the Magnus effect for spinning balls in flight.

While the engine will take care of the rigid body dynamics, it will be up to you to figure out the extra aerodynamic forces. Approximating some behaviors wouldn't be too hard- a frisbee is clearly going to have a harder time moving along its vertical axis (perpendicular to its wide surface), so exerting some extra drag forces there would be easy enough. You could probably go a long way with these sorts of not-quite-accurate-to-reality hacks.

For all the more complex realistic behaviors, I'd recommend googling around- there's likely some frisbee aficionados out there :)
ultimateCoder
Posts: 2
Joined: Tue Jul 24, 2012 11:31 pm

Re: Frisbee

Post by ultimateCoder »

Hm... not the easy and encouraging response I was hoping for... (space.EnableAerodynamics = true;)

Alright, well the good news is that I can hack most of the complicated equations because I know the frisbee's shape and dimensions. I have been contemplating how to go about simulating the needed forces:

Gyro Stabilization - Spinning faster on one axis stabilizes spin on other axes (Need advice on how to do this)
Magnus Effect - A force is applied at the cross product of the direction of velocity and the axis of rotation and the force is scaled by the angular velocity and linear velocity.
Lift/Drag - We figure out the angle of the frisbee by getting the dot product of the normalized velocity and the up of the frisbee then apply a force towards the up vector of the frisbee that is scaled by the angle and the velocity.
Angular lift? - I'm thinking I would also need to apply a change in angular velocity so that it changes its rotation as it flies.

Would this be all of the forces that I need? Are my thoughts for implementation correct? I took physics in high school and college but I'm certainly not an engineer.
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Frisbee

Post by Norbo »

Gyro Stabilization - Spinning faster on one axis stabilizes spin on other axes (Need advice on how to do this)
Easier than you might think! It's pretty much automatic. Try this in the demos:

Code: Select all

            CompoundBody top = new CompoundBody(new[] 
            { 
                new CompoundShapeEntry(new ConeShape(1, 1), Quaternion.CreateFromAxisAngle(Vector3.Forward, MathHelper.Pi)),
                new CompoundShapeEntry(new CylinderShape(.5f, .2f), new RigidTransform(new Vector3(0, 0.5f, 0), Quaternion.Identity))
            }, 10);
            top.AngularDamping = 0;
            top.AngularVelocity = new Vector3(0, 100, 0);

            top.Position = new Vector3(0, 5, 5);

            Space.Add(top);
The engine does, however, take some shortcuts for greater stability. To make it more realistic, you can turn on angular momentum conservation and RK4 angular integration:

Code: Select all

            MotionSettings.UseRk4AngularIntegration = true;
            MotionSettings.ConserveAngularMomentum = true;
These settings probably won't have much of an effect on the result, though.
Magnus Effect - A force is applied at the cross product of the direction of velocity and the axis of rotation and the force is scaled by the angular velocity and linear velocity.
The direction of the velocities does not need to be computed here; the cross product can take the linear velocity and angular velocity directly. An arbitrary scalar can be applied to tune the result; my guess is that it will end up being fairly tiny for a frisbee.
Lift/Drag - We figure out the angle of the frisbee by getting the dot product of the normalized velocity and the up of the frisbee then apply a force towards the up vector of the frisbee that is scaled by the angle and the velocity.
Angular lift? - I'm thinking I would also need to apply a change in angular velocity so that it changes its rotation as it flies.
That would be a decent approximation.

Applying an impulse a bit off center to represent lift will introduce angular motion without having to worry about a separate force. This is an approximation of how reality works- the lift force is distributed over the surface, but not perfectly uniformly. Instead, the net force ends up being a bit ahead of the center of mass. The imbalance tilts the frisbee.

Of course, there's comes a point where a level of approximation must be decided on. Using some parts of a detailed approximation and some parts of a much more relaxed approximation could result in noticeably non-frisbeelike behavior. For example, including only one part of 'realistic' angular motion from lift forces could end up requiring other details to balance out the behavior and prevent constant looping.
Would this be all of the forces that I need?
Unfortunately, I have no special insights about frisbees. I did not play with them enough to gather a detailed appreciation for all of their subtle workings :)

How much you 'need' depends on what your goals are. I'd recommend just trying out some implementations and seeing how they feel. If something seems to be missing, google around for the mechanics of frisbee flight and try to fill in the gap.
Post Reply