Using the environment map
MascotCapsule V3 can process sphere mapping by using a special texture for sphere mapping, when the models are specified with sphere mapping attributes.
Table of contents
1. Environment mapping
Environment mapping is a mapping method where surrounding environment is reflected on the surface of a model.
Sphere mapping is an environment mapping method where 360-degree surrounding scenery is reflected on the model. There are other environment mapping methods, such as cube mapping where 90-degree horizontal surrounding scenery and 90-degree vertical surrounding scenery are reflected on the model, respectively.
2. Specifying the environment map setting
In order to load a texture for sphere mapping, specify false for the second parameter when creating the Texture object. Also, use the setSphereTexture( Texture sphereMap ) method in the Effect3D class to enable sphere mapping.
Specify null here to disable sphere mapping. In this sample, the soft key enables/disables sphere mapping. Also, press-down the direction keys to rotate the camera position.
sphereMap = new Texture( "SphereMap.bmp", false );
/**
* commandAction() method
* Process when the soft key is pressed-down (changing the rendering parameter)
*/
public void commandAction( Command c, Displayable d ){
/* Switching the sphere map */
if( label.equals( commandLabels[ 0 ] ) ){
Sphere mapping enabled (left), disabled (right)
Quick Links
- MIDP + com.mascotcapsule package (MascotCapsule V3 API)
- Basic rendering
- Rendering a 3D model / Semi-transparency using BlendHalf / Additive and subtractive blending effects / Switching the animation data / Switching the pattern using dynamic polygons / Lighting / Shading / Using the environment map / Rendering the primitives / Reducing the texture distortion / Preventing Z-sort rendering mistakes under certain circumstances / Coordinate systems and the camera / Projection methods
- Basic rendering
- Go back to Samples index

