Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

TechnoGoth

Texture Orientation in a tile bade game.

This topic is 5557 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

Hi I''m new to using openGL, and was looking for some help. I''m creating a 2D turned base strategy game that use a map made up of tiles. There are three basic kinds water, grass and forest as well a large number of transition tiles. currently the map is set up using a 2d array, containg an index number for the corrisponding tile. My problem is with the tiles, now I have created them noproblem, however most of the transiation tiles are just the same tile rotated 90,180,or 270 degrees and some fliped and then rotated. So I was curious is there a simple way to take a texture and rotate it as well as flip it? This would cut my total number of tiles down by about 80% or should I just stick with the current system of lots of tiles?

Share this post


Link to post
Share on other sites
Advertisement
just flip or rotate the texture coordinates:

(0,1) (1,1)
+----+
| |
| |
+----+
(0,0) (1,0)
// base layout

(1,1) (0,1)
+----+
| |
| |
+----+
(1,0) (0,0)
// horizontal flip

(0,0) (0,1)
+----+
| |
| |
+----+
(1,0) (1,1)
// rotate 90 CW

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!