environment map some useful tips when working with imported objects
When using imported models, or after several matrix modifications, the exported object can produce unexpected results because of the difference in the way the matrices are handled between max and ogre (or any real-time engine). To solve this apply the "Reset Xform" to your objects to obtain a clean matrix. Alternatively you can use the "Box method" as noted in the Tips section.
1. Open the file "gt4.max" from the Tutorial2 folder. It loads a car composed of several objects
2. We will apply a "Reset Xform" to the loaded objects.
As result of the creation process, if we export the objects now, their positions, rotations and scales will be different from the current displayed in max.
Select all objects in max
In the Utilities tab click on "Reset XForm" button, and click on the "Reset Selected" on the displayed rollup
3. Flip the reversed polygons.
After reseting all matrices, you will see that some objects now have their polygons flipped, this is the case when using negative matrices while creating them.
Select the "gt4 ref body" object and collapse the stack Note: A useful script is included in the Tips section to collapse the stack of multiple selected objects
Put in Sub-objects/Element mode
and select all elements
Click on the Flip button of the Surface Properties/Normals rollup
Now the selected object is displayed correctly
4. The "gt4 ref lamp pod" needs to flip its normals too, we repeat the previous procedure with this object
5. Create an Omni light on the position x: -12.613 y:-18.912 z:34.691 (or on a similar place if your max units setup is different) to give objects some illumination
6. Activate the Ogre Viewport
7. Evaluate to Ogre Material
Open the Material Editor and locate the "gt4 tex" material
and upgrade to Ogre Material.
8. Set Material properties
Open the first Pass material (click on technique_0, and in pass_0)
Use this settings:
Set the Ambient and Specular colors to white Glossiness to 10.0 Emissive to r:139 g:139 b:139
9. Add an Environment Map
Create a new Texture Unit
and set the bitmap to "spheremap.png" file
Use this settings:
Blend Mode: add Env Map: spherical
10. Now you have car with environment mapped paint that is relative to the camera, go ahead and move the camera to see the effect on the car paint
The display should be similar to this image
11. You can use the same effect with different settings (Pass blend mode: color_blend and TextureUnit blend mode: modulate) in the "gt4 glass" material of the windows