This software can obtain the geometric objects, lights, cameras, and other information of the 3DS MAX scenario in real time and convert it to generate the scenario information in the ogre3d format, use the Ogre rendering engine to render the built ogre scenario in the manually defined Visual View of 3DS MAX.
Development Environment: 3DS max sdk 2009 + ogre 1.6.4 + vs2005
Brief description of functions and technical principles:
1. Add some geometric objects to the 3DS MAX 2009 scenario, add two light sources, and add two cameras, as shown in:
2. Right-click perspective-> views-> extend and select Siemens ogre viewport. This is a 3DS MAX extension developed by me. When 3DS MAX is started, it is loaded as a dynamic link library by 3DS MAX.
3. After you click Siemens ogre view in the previous step, a Win32 subform is registered with the system, which is loaded as a child form of 3ds max. After the child form is loaded, manually configure ogre to initialize the resource and bind it to an ogre rendering viewport. Right-click the Ogre rendering window form in the upper right corner. The function menu of the child form is displayed, as shown in:
4. Select load texture to load the texture map of the ry. Select all geometric objects in the scenario and click load selected objects. The program will do three things:
(1) parse the geometric information in the 3DS MAX scenario: traverse the mesh tree of 3DS MAX, the vertex coordinates, vertex normal vectors, vertex texture coordinates, vertex color, and the corresponding material indexes and Fixed-Point Indexes in the mesh are decomposed. The light source and camera information in the scenario are parsed;
(2) convert the parsed information to the ogre format, build the mesh and entity tree of ogre, and build the Ogre scenario;
(3) create vertex Buffer, index Buffer, and Texture Buffer, import the data generated by (2) to these Buffer, and render the output results in the form.
Shows the final rendering result:
5. The above is the default viewing angle. We have created two cameras in the scenario. In the plug-in function menu, you can switch to Camera 1 or Camera 2. For example:
Camera 1 perspective
Camera 2 perspective