Книга: DirectX 8 Programming Tutorial

Scaling makes your object darker?

Scaling makes your object darker?

One extra thing to note is that if you scale the mesh you will also scale the normals. This will have the effect of making the object darker the more it is scaled. To fix this problem we need to enable the D3DRS_NORMALIZENORMALS render state. This is done with one call to the SetRenderState function as shown below.

m_pD3DDevice->SetRenderState(D3DRS_NORMALIZENORMALS, TRUE);

For this tutorial we will create three spaceships and rotate them each about a different axis. The final scene when rendered will look something like the screenshot below:


Оглавление книги


Генерация: 0.037. Запросов К БД/Cache: 0 / 0
поделиться
Вверх Вниз