Allegro triangles...

Started by
1 comment, last by GameDev.net 18 years, 5 months ago
Eazy now, How would I go about drawing a rotating triangle to the screen using allegro (I use dev-c++), using the triangle drawing function (specify the 3 sets of x and y co-ords to draw from). I want it to increment a single variable (int direction) and draw the triangle over and over in the new rotation position. How? Erk! -Adam
E is the best letter of the alphabet, use it wisely.
Advertisement
I don't know if this would work or not, but here's an idea:

Store your points in some sort of Point structure (so Point p has elements p.x and p.y). Pass your points to a rotation function which converts the points to polar coordinates, change theta by the number of degrees you want, the convert back to x,y values that can be used by Allegros triangle function. I believe this would work.
You can also pre-render triangle into BITMAP and use rotate_sprite.

This topic is closed to new replies.

Advertisement