Samples
Preventing Z-sort rendering mistakes under certain circumstances
MascotCapsule V3 uses the Z-sort method for hidden surface removal to simultaneously render multiple models with very different sizes, for example, when a small object is placed on a large flat surface, etc. In such cases, models are sometimes not rendered correctly because of Z-sorting mistakes. If the positional relationship of polygons is known in advance, separately execute the rendering and flush processes for particular objects, in order to avoid such rendering mistakes.
In order to render the small object when it is placed on the large flat surface as stated above, execute the rendering and flush processes of the large flat surface first, and then execute the rendering and flush processes of the small object. Let's call this a "double-flush" method, for purposes of explanation. In the sample program, a small flat surface and a small sphere are placed on a large flat surface. When they are normally rendered, the small flat surface and the sphere will be partly hidden. However, they are rendered correctly by using the double-flush method.
Let's take a look at the portion of the sample code that executes the double-flush process. Normal rendering and the double-flush rendering are switched when the soft key is pressed-down.
for(loop = 0; loop < FIG_NUM; loop ++ )
{
IMICRO3D_Render_setTexture ( pMe -> pIM3D,&pMe -> mc_data.render,&pMe -> mc_data.texture );
/* Rendering registration */
if( HI_TRUE ! = IMICRO3D_Render_drawFigure ( pMe -> pIM3D,
&pMe -> mc_data.figure [ loop ] ) )
if( pMe -> mc_data.flush_flag == HI_TRUE )
{
IMICRO3D_Render_flush( pMe -> pIM3D, &pMe -> mc_data.render );
if( pMe -> mc_data.flush_flag == HI_FALSE )
{
IMICRO3D_Render_flush( pMe -> pIM3D, &pMe -> mc_data.render );
![]() |
![]() |
| Rendering using double-flush | Rendering without double-flush |




