![]() |
|
|
Import model in Visual3D.NETFrom $1by Steaph About :The purpose of this tutorial is to give you the basics of the model import process and materials configuration with Visual 3D.NET Beta 2.0. It will show you two simple ways to import and give you a glimpse of the model and material editors. Two ways : The default import format for Visual 3D.NET is the “.mesh” format from the OGRE engine. Not every modeler is able to export in OGRE. So, this tutorial will focus first on importing from any modeler, via a third party software (the Deled editor from Delgine), and second, on the importation from Blender, which can export in “.mesh” with the help of a little script. Moreover, the blender exporter handles skeletons and LOD. (Take note that the OGRE website offers a wide range of exporters for many 3D modeling tools. More information here) --------------------------------------------------------------------------------------------------------------------------------------------------------------------- Part one:Importing, from any modeler, simple mesh without LOD or Skeletons. Requirements:
- Step 1:Before anything, you have to install the Deled editor. Launch the ".exe " file you have previously downloaded, and follow the instructions. Unzip the OGRE exporter. It's a ‘.dll’ file you have to put in the “plugins” directory of Deled. "C:\Program Files\DeleD LITE\Plugins" (for now, you also have to close Visual 3D.net) - Step 2:You first have to export your mesh in “.obj”, “.3ds” or ”.x” format. As many modeler and 3D solution suit are capable of that, we won’t discuss here the way used to obtain these files. Thus, we’ll assume that you have your mesh, along with his texture map. For this example, I will use a mapped cube with 3 different materials. The first is a mapped picture (you can see that only three faces are mapped), the second a black solid color, and the third, a gray color. This way we’ll can deal with the main needs in an importation. (You can fin the mesh in the "file" window, at the end of this page) - Step 3:Import your mesh in Deled, using “ Plug-ins -> X importer” where X is the format of your mesh. You’ll perhaps have to rescale your model during import, regarding which modeler you have used. Your mesh will appear without his texture (with a beautiful error popup). Don’t worry. You can solve this by putting your texture in the file indicated by the popup, but really, as we are using Deled as a mesh converter, it’s useless. In the scene directory of Deled, (in the "scene inspector topic) you should now see the three parts of your mesh. (One part with a mapped image material, one with a plain gray material and one in black.) - Step 4:Go to “ Plug-ins” once again, and chose “Ogre Exporter”. Open the explorer and chose a place where to export your mesh. Give it a name and don’t forget to add “.mesh” after it. (i.e. cube.mesh) You now have a "Cube.mesh", an image named "color" and a ".material" file. We'll use them in a minute. - Step 5:Open the Visual 3D directory and go to models in the beta assets. ("Projects/Demo Assets/#Media/Models"). Create a new folder named « my models », and, in it, a folder with the name of your model (in our example: "Projects/Demo Assets/#Media/Models/MyModels/Cube/" In “Cube", you will put your freshly created “.mesh” file, along with its texture map (the texture you have exported from your modeler) and its .material. You now have a file named “Cube”, in the Visual 3D.net directory"Projects/Demo Assets/#Media/Models/MyModels/Cube/cube.mesh" , containing your mesh in OGRE format, a “.mat” file and a texture map. - Step 6:Open Visual 3D.net architect and open the Model viewer. Go to the Assets menu, "/#Media/Models/MyModels/Cube". Your model should be there. Drag and drop it in the viewer. If you have used the cube I have joined in this tutorial, the model viewer could become totaly dark... Zoom out (wheel mouse) to take a larger perspective on your work. At this point, the cube is totaly black. Shadows or lights don't affect it. So, it's time to give it some materials. --------------------------------------------------------------------------------------------------------------------------------------------------------------------- Part two :Basic texturing using the material editor. Requirements:
- Step 1:We first need to create a specific material for your mesh, that will contain your texture map informations. Open the material editor of Visual3D.NET and click on "create new material". The material editor will load a default checker image, to cover the mesh in the preview window. This material is now temporary saved in your asset window, under "Materials/new material". Keep in mind that if you don't use your material in a mesh before closing Visual3D.NET, it will be erased during shut down. To keep a material you don't plan to use straight head, use the "save as" option that allow you to save your material settings in a XML file. - Step 2:First, let's change the name of your new material. "Textured Blinn-Phong #1" sounds really cool and serious, but it's not rather informative. So, in the little "name :" window, change "Textured Blinn-Phong #1" (don't touch to "material/") by anything you want. "Cubemap" in this case. Press enter. You can now see a different asset name, in the "new material" folder. - Step 3:We now have a new material named "Cubemap". This material will be applied on the mapped part of our mesh, so wee need to import the mapping texture in it. In order to achieve that, let's take a look on what offer the material editor.
To summarize our choice, we can say that we let everything in the default settings and we will do the same for the "lighting" part of the editor. So, open the texture window of the editor. - Step 4:Currently, the display texture is a "checker". In order to exchange it with the mapped texture of our mesh, go in the asset window. Open "texture", navigate to "Textures/#Media/Models/MyModels/Cube". You should find your texture there. Drag and drop it in the preview texture window. Our texture is now displayed on both preview windows. The material is ready. - Step 5:Leave the material editor, and go to the model Viewer. Drag and drop your model from the asset window to the viewer. In the parts and material window, you should see three different names. This names correspond to the different materials of our cube. In the example cube, the first is the texture mapped material, and the two other are procedural materials. - Step 6:Select the mapped part. In the "material" window, the name of the material assigned to this part of the mesh appear. The material has indeed the name of our texture map, but is totally empty. So, open the "material explorer". Go to "new material" and select "Cubemap". Our texture map is now perfectly applied on our mesh. Don't forget to save the modifications on your mesh with the "save" button near the object name.
|
|||
Powered by MindTouch Deki Wiki |
I Just added my first model using blender + OGRE exporter...cool it keeps even the material properties!
Very helpful !