Creating an Interactive 3D world with C# and DirectX
Then, you create the first mesh object to load the "Drawer" in the room:
TVScene.CreateMeshBuilder (Name As String)
Creates a new empty mesh builder (TVMesh) and add it in the scene graph. You must ALWAYS use this method to create a new mesh or to load one; otherwise, it will not be included in the scene graph, and will probably be not rendered.
//Create 3D object mesh
Obj1 = TVScene.CreateMeshBuilder("Obj1");
Then, load the X files here from the 3D object models that you created in 3D Studio Max and exported them as ".x" files. There are three functions to load an X file, depending on whether the file is animated or not or whether you need to import the material and texture from 3D Studio Max.
TVMesh.LoadXFile(Filename As String, LoadTextures As Boolean,
LightingMaterial As Boolean)
Loads a X (DirectX Format) static model into this empty mesh.
TVMesh.LoadSkinMesh(Filename As String)
Loads a SKinned Mesh file (x animated file) into this empty mesh.
TVMesh.LoadXFileHierarchy(Filename As String,
WithAnimation As Boolean,
WithMaterials As Boolean)
Loads a SKinned Mesh file (x animated file) into this empty mesh.
//Here we load the X files for the meshes one by one for all the 10 objects
Obj1.LoadXFile("Media\Meshes\drawer1.x", true, true);
When you load the obj1 object in the scene, you get the following result:
Obj1.SetPosition(380.0f,-80.0f,180.0f);

Figure 6: Loading an object in the room
After applying the texture to the floor and the drawer object, your scene is modified to resemble this:
Room.AddFloor(global.GetTex("Carpet"), -350.0f, -350-0f, 350.0f, 350.0f,
-50.0f, 10.0f, 10.0f, true, false);
Obj1.SetTexture(global.GetTex("Wood"),-1);

Figure 7: Applying texture
I like to change the walls, too, so apply another texture "Wall":

Figure 8: Applying texture to the walls
Likewise, you have to add all the objects in the scene, specifying their positions, textures, and other properties if required.



Solid state disks (SSDs) made a splash in consumer technology, and now the technology has its eyes on the enterprise storage market. Download this eBook to see what SSDs can do for your infrastructure and review the pros and cons of this potentially game-changing storage technology.