• entries
    743
  • comments
    1924
  • views
    578705

Sideline project

Sign in to follow this  
Aardvajk

67 views

Decided today to start a little sideline project:



You control the little triangle with rotate left/right and thrust, but the triangle stays in the middle of the screen and the whole world rotates about you as you turn.

Now the problem - how the hell do you test for intersections between arbitrary triangles? Bearing in mind I'm a maths dunce with no understanding whatsoever of anything remotely complicated.

Suggestions in simple terms either here or in the thread I've just started would be greatly appreciated.

[EDIT] jyk came to my rescue in the thread with a very elegant lump of code.

Converted it to C# for a quick visual test:



You click three times to define one of the triangles, then the title bar says "Intersects" if they do and "No" if they don't. All works flawlessly.

Should be a breeze to convert to C++ for the game. Now the next problem is actual collision response, which I guess is even more complicated. Maybe I'll just make the ship blow up [smile].
Sign in to follow this  


1 Comment


Recommended Comments

I can say first-hand that getting into the math behind these things is an excellent investment of your time. Generally, the more math a game developer knows, the more interesting things he or she can make their code do. [smile]

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now