#### Archived

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

# Rotating a 2d isometric map...

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

## Recommended Posts

I just got this idea and was wondering if it had already been used before... Basically it would just rotate the entire map 180 degrees, also flipping each node making it look as if you had rotated the camera 180 degrees. This is a little hard to explain now that I think about it. Say, for example, you wanted to look on the other side of a wall, but because it's 2d, you can't just 'move' the camera expecting it to look 3d'ish (duh), so it would just reverse every map coordinate, like this: Original: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 1 0 0 0 1 0 0 0 Flipped: 0 0 1 0 0 0 1 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Now, for those of you that understand, whaddya think? For those that don't, I'll think about wording it better. [edited by - Faze on September 13, 2002 12:54:14 AM]

##### Share on other sites
I think this is used in The Sims, but rotation happened in 90 degree angles. I think it''s a nice idea, but not sure if it''s very possible in all cases... I considered this feature to my project but had to dump it because of graphics reasons.

saeZ

##### Share on other sites
some versions of sim city used it. if you need some tiles or isometric sprites let me know

##### Share on other sites
The biggest problem will be makeing the tiles look correct...other then that rotation is EXTREAMLY simple

here is a simple map:

..0123456
0.oooo1oo
1.oooo1oo
2.oooo1oo
3.oooo1oo
4.11111oo
5.ooooooo
6.ooooooo

notice something about the array indexes:

this would draw the map as shown:

FOR X = 0 TO 6
FOR Y = 0 TO 6
DRAW TILE( MAP(X,Y)) AT X,Y
NEXT Y
NEXT X

but lets rotate it 90 degrees clockwise...to do so we must put the tile at map location ( MAP(0,6)) in the same place we would put the tile if drawing normaly.

so something like this could work:

FOR Y = 6 TO 0
FOR X = 0 TO 6
DRAW TILE( MAP(X,Y)) AT (6-Y),X
NEXT X
NEXT Y

Provided that the tiles look correct from each angle...all that is needed to generate 90 degree rotations is a change in how the map array is scanned

##### Share on other sites
Roller Coaster Tycoon allows you to rotate the map in 45 degree increments. I''m not sure how he did it, but it works quite well.

As stated above, you will need to change how you draw your tiles. Different orders for different angles. If you have varying tile heights, you may have to adjust your height data as well (dpending on how it''s stored). All objects would need to be redrawn at each angle (4 total for 45 deg rotations, 2 for 90 degree rotations). It would look odd if the map rotated while your statues did not! If you use a 3D modeler to generate your graphics this would simply require rotating each object appropriately. Also, any tiles that have distinctive features need to be redrawn for differeing angles. Generally, I''d imagine the base tiles would be okay, but any fringe tiles will need to have rotated views.

You would need a flag to let you know the current view angle, then draw appropriately. These are just ideas, as I''ve never done this kind of thing. Hope it helps out a bit.

##### Share on other sites
Tombstone allows for 8 views and it doesn''t require rotating the map matrix to do it which is really really slow. The number of views you can have depends on how your tiles are rotated. If you use a standard 45 degree tile you''ll only be able to get 4 rotations out of it.

You don''t want to do just a single 180 degree flip. It looks really really bad in practice. You want as clean of a rotation as you can get.

So yes, it has been done before and it''s not difficult at all. You just rotate the camera using 2D math instead of 3D math.

Ben

IcarusIndie.com [ The Rabbit Hole | The Labyrinth | DevZone | Gang Wars | The Wall | Hosting | Dot Com | GameShot ]

##### Share on other sites
If you are using Direct3D to render the tiles (which I strongly recommend you do- I converted my rendering function from DirectDraw to D3D in just a couple hours and it increased my framerate from 40 something to 62), you can easily rotate the tiles in any increment without having to making multiple copies of your textures at different orientations. My engine can render with both square and isometric tiles and allows you to zoom in and out. And with only 1 texture!

##### Share on other sites
Yes, but you''re incredibly limited in what types of tiles you can use.

Tombstone is fully 3D engine wise (everything has real depth) but rendered in ISO. It would be impossible to use your method and achieve the full 3D gameplay. Most ISO games are actually 2D games made to look 3D. Tombstone is a 3D game rendered in fake 3D. Moving it to full 3D would be as trivial as moving from DDraw to D3D was.

Going from DDraw to D3D is trivial and highly recommended as long as you stick to D3D7. DX8 will kill any hope of your game running on older systems even though D3D7 would have run just great. DX8 is suck and die for that reason.

For instance, my current project whips along with DX8 on a P200 with a Voodoo3 2000 (using a 3rd party driver), however the same project cannot run on my 133 laptop because my laptop has a video card that doesn''t support DX8. I could use DX7 and get the same visual and speed results as DX8 does except it would run on the laptop. I see a problem with this.

Ben

IcarusIndie.com [ The Rabbit Hole | The Labyrinth | DevZone | Gang Wars | The Wall | Hosting | Dot Com | GameShot ]

##### Share on other sites
quote:
Original post by KalvinB Going from DDraw to D3D is trivial and highly recommended as long as you stick to D3D7. DX8 will kill any hope of your game running on older systems even though D3D7 would have run just great. DX8 is suck and die for that reason.

For instance, my current project whips along with DX8 on a P200 with a Voodoo3 2000 (using a 3rd party driver), however the same project cannot run on my 133 laptop because my laptop has a video card that doesn''t support DX8. I could use DX7 and get the same visual and speed results as DX8 does except it would run on the laptop. I see a problem with this.
You''re making it sound as if DirectX8 was bad in general, although I''m pretty sure you''re not intending to. I agree with you about the bad hardware support, so if you don''t want the new DirectX8 features (mainly shaders, multiple vertex streams, volumetric textures and index buffers basically) you should go with DirectX7. If you do want to use them, go ahead, the old hardware wouldn''t support most of it anyway.

- JQ
Full Speed Games. Period.

1. 1
2. 2
Rutin
17
3. 3
4. 4
5. 5

• 26
• 10
• 11
• 9
• 9
• ### Forum Statistics

• Total Topics
633717
• Total Posts
3013510
×