Source code for an old project of mine.
YouTube demonstration: https://www.youtube.com/watch?v=sH9QmZl2MQw
An XNA implementation of ellipsoid-triangle collision detection and response.
Based on the "Improved Collision Detection and Response" by Kasper Fauerby (http://peroxide.dk/tuts_c.shtml)
Also note the "gravity" isn't really gravity, just a pointed down velocity (for simplicity).