Archived

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

TechnoGoth

Texture Orientation in a tile bade game.

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