Allegro.cc
Projects
Action252
Adventure22
Arcade216
Board Games30
Demos24
Emulators10
Other68
Puzzle139
Role Playing40
Sports25
Strategy58
Utilities46
Resource Directory
Code Gallery3
Compilers12
Help & Documents13
Libraries63
Media2
Tools8
IOTD: Triangles
Triangles
Triangles, by DanielH

Everything I've been working on lately has nothing graphical to show so I'm showing you a testing program I wrote and recently modified.

It's my triangle collision detection. It could seriously be optimized, but that isn't my goal at the moment.

I'm having difficulty with the collision detection of the ball. The point where the triangles meet, the ball is passing through. I could be correct though. The end points of the triangles aren't very wide. Hmm. Maybe you could test it and help me.

To make it easier to make triangles I added a Bezier thingy. You could add more curves by modifying the file 'points.txt'. It's not quite accurate, but that's ok.

http://www.dharmon.progranism.com/stuff/curves.zip

If that doesn't work then this will

http://www.dharmon.progranism.com/stuff/curve.htm
Includes source and win32 binary

P: Move ball to mouse position

Up: Increase Bezier divisions
Down: Decrease Bezier divisions

Minus: Changes - which Bezier to work on
Equals: Changes + which Bezier to work on
A: moves point 1 to mouse position
S: point 2
D: point 3
F: point 4

L: Toggle show Bezier control lines
N: Toggle show triangle normals

F1: screenshot
Shouldn't this have been posted in the Depot section of the forum rather than as a screenshot? - William Heatley
Did you read the first sentence? Just showing off something. And what could the problem be with triangle.cpp? - DanielH
Even tho it's not very pretty, I think this is the perfect spot for it -- it caught my eye as something that looked cool when I opened up the main page -- at full resolution kind of boring tho. Looks better small. I suck at geometry or I'd offer to help, good luck Dan. - Michael Jensen
Seems to be compiled with the debug dll and I don't have one handy. I tried compiling but triangle.cpp had errors. No such luck :( Looks cool though. - Steve Terry
This section is only available to registered Allegro.cc members.



The Gallery | Add your own image!
Poll
Is grammer and spelling important?
View Results