I have a big map with isometric tiles(3d camera), how can i draw only visible tiles ?
Whats the best way to do that ? space partitionning (octrees etc...)?
If all the tiles are approximately the same size, lie roughly on a flat plane, and the camera is always a set distance from the plane, simply calculate the tile that the camera is looking directly at and then cull any tile whose
When considering the 'value', consider the obliqueness of the vertical component of the FOV when using an isometric perspective.
Further optimization can be had by doing the same with small groups of tiles rather than each tile individually.
This method will usually give a number of false positives but will cull the vast majority in a big map situation and is relatively cheap.
This approach works for diamond shaped isometric maps.
1) Find out what the top left tile on the screen is.
2) Depending on how you draw the map offset this by 2 tiles in both directions off the screen. So now you chosen a tile outside the viewport area.
3) Calculate how many horizontal rows and how many vertical rows need to be drawn so you end up on the opposite site of the viewport.
4) Now draw your map row by row.
Hope this helps!
Figure Out a visible rectangle of tiles. Only draw that. Isometric vies complicate things, but only slightly. Simply start at the leftmost, topmost tile and draw that row. Then the next. You should be able to convert between screen and world space, so converting and visible spot on the screen aligned visible rect to tile coords should be straightforward. It depends on your internal representation of the game world, so it's hard to give more specific math.
Spatial partitioning will help more with very very worlds. A simple fixed-scale quad tree is fine. Or even fixed size chunks.