3D map

kinda hard to explain but what I want to do is place meshes about 200 of them I guess it would be in world space then each time a player moves the camera with point to there current location, what is the best way to get the cords for the mesh not all 200 need to be shown on the screen at one time just maybe 30 -40 tops, im just kinda at a loss on how to figure this out any help would be great
thanks      


Answer this question

3D map

  • bluemoon2181

    Okay, I think I get what you're talking about...

    You want to load your 3D mesh objects from a file.

    You need to give them appropriate coordinates so that they appear in the correct position on the **screen**.

    As an example, you might want a 3D teapot mesh to always appear in the top-left of the screen as the end-user sees it.

    Correct so far Smile

    If so... It's not a straightforward question, nor is it a particularly common way of constructing a 3D world. You'd have to do various bits of matrix-maths magic in order to go from a screen-coordinate (say 100,100) back to an appropriate 3D coordinate in world space.

    Functions like D3DXMatrixInverse() when applied to the world*view*proj*vport matrix should allow you a "backwards" route from screen-space to world-space. Alternatively you can feed the necessary pieces into D3DXVec3Unproject() to do it all in one-step.

    Hopefully I haven't gone off in the wrong direction with that one, but post back if you still need help...

    Jack


  • HJ Liu

    it would be 3D and I have read tons of stuff about creating your world my only question is im having a problem understanding how to caculate the cords for the objects im placing in world space, so basicly I am yet to find a place that explains caculating world space cords so objects look in order when turned into screen space.
    thanks

  • Magnus Green

    Can you rephrase your question   I can't tell if you want to know how to render a 3D map or render a 2D "isometric" style tile-based map.

    If it concerns 3D maps, can you tell us what books/articles you've already read to try to understand this non-trivial challenge (there's a colossal variety of ways to do 3D mapping, so we need you to tell us where you're starting from).

  • iJatin

    That would be a lengthy discussion Smile

    Try this:  Find an entry level book on 3D terrain mapping, like Frank Luna's book "Introduction to 3D Programming with DirectX 9.0"  Or you can dive deeper by reading Greg Snook's "Real-Time 3D Terrain Engines".

    You might also want to search the colossal number of discussions on 3D terrain mapping at www.gamedev.net or on USENET newsgroups.


  • 3D map