Sign in to follow this  
MonkeyCircus

Allegro triangles...

Recommended Posts

MonkeyCircus    122
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

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
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.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
You can also pre-render triangle into BITMAP and use rotate_sprite.

Share this post


Link to post
Share on other sites

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

Sign in to follow this