So I have seen many 3D tutorials creating heightmaps and big landscapes but I am hoping there is something simple that i can throw together. If I was to do something doom/wolfenstien-like, do i just draw a cube and texture it? I guess my question is, How should i go about creating a very simple box-like room?
|
The topic you're asking about is more involved and broad than you might think. Drawing is only half of the problem at that point; chances are, if drawing a room is a challenge, then 3D collision detection is going to be a pretty big task. I'd highly recommend taking a look at the XNA starter kits and seeing what you can learn from there. The XNA Starter Kits are available at: http://creators.xna.com/en-US/education/starterkits/ To answer your original question, the XNA Creator's Club website has a code sample for drawing 3D primitives at: http://creators.xna.com/en-US/sample/primitives3D And this howto (for XNA 1.0, but with the right concepts) is fundamental to moving forward: http://msdn.microsoft.com/en-us/library/bb464051(XNAGameStudio.10).aspx |
|||
|
|
In theory you can build the entire level in some 3D editor (MAX, Blender etc), export it as a single model and draw it using the methods explained in XNA's 3D game tutorial. This is not what you want, unless we are dealing with very small spaces. Usually the world geometry is partitioned for (mainly) the following reasons:
The two main techniques used for this purpose in indoor scenes are binary space partitioning (BSP), used by doom/quake and friends, and portal/cell (of Unreal fame). There are advantages and disadvantages to both techniques. Both are a substantial amount of work to implement from first principles. I recommend you base your work on an existing engine that does this for you. |
||||
|
|
|
If you drew a cube and textured it you would have a cube, not a room. I don't know how XNA define "primitive", but what you should be doing is drawing polygons to form a square or a rectangle for a single wall of your corridor. |
|||
|