Skip to main content
gamedev.net
🔒 Locked

3d tilemap creation

Started by blue-ice2002 Sep 10, 2003 at 4:23 PM 1 replies 700+ views
Original Post
blue-ice2002
blue-ice2002
hi i wrote a 2d strategy game.i wanna port it to 3d.i mean i have a tilemap like 40*40 tiles and when your mouse is x = 52 y=15 for exampleit means that you are at second tile at the top of the map.i mean if u think like an array of tile u are at [][x][][] [][][][] [][][][] here. but when it comes to 3d, lets say i made a tilemap composed of triangles which 2 of them make a quad,i mean a tile and we look from 0,1,0 xyz to forward.tiles are seen at an angle ,and it means they will be seen in a projectioned form. MY question is how will i decide which tile user clicked,i mean because of 3d and projection we dont know how many tiles are seen or if we scroll how many tiles will scrolled accordingly. how can i do mouse mapping to know which tile it is like i did in 2d.? thanks for reading
PlayGGY
PlayGGY
Or, since the map sounds like it is completely flat (all tiles are on the same plane) you could just calculate where the four corners of the tile will be rendered on the screen and see if the cursor is in it.

[edited by - PlayGGY on September 10, 2003 7:26:19 PM]

[edited by - PlayGGY on September 10, 2003 7:58:35 PM]

[edited by - PlayGGY on September 10, 2003 7:58:45 PM]
And the rockets' red glare, the bombs bursting in air,gave proof through the fight that our flag was still there.Oh say, does that star-spangled banner yet waveover the land of the free and the home of the brave?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.