Jump to content
  • Advertisement
Sign in to follow this  
MonkeyCircus

Allegro triangles...

This topic is 4625 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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
Advertisement
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
You can also pre-render triangle into BITMAP and use rotate_sprite.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!