0
Iは、パーリンノイズを使用して地形を生成した後、使用して法線を計算してい:DX10地形法線
D3DXVECTOR3 v0 = aoVertices[auiIndices[i]].Position;
D3DXVECTOR3 v1 = aoVertices[auiIndices[i + 1]].Position;
D3DXVECTOR3 v2 = aoVertices[auiIndices[i + 2]].Position;
D3DXVECTOR3 v3 = aoVertices[auiIndices[i + 3]].Position;
D3DXVECTOR3 v4 = aoVertices[auiIndices[i + 4]].Position;
D3DXVECTOR3 v5 = aoVertices[auiIndices[i + 5]].Position;
D3DXVECTOR3 vNormal;
D3DXVECTOR3 vCross;
D3DXVec3Cross(&vCross, &D3DXVECTOR3(v2 - v0), &D3DXVECTOR3(v1 - v0));
D3DXVec3Normalize(&vNormal, &vCross);
aoVertices[auiIndices[i]].Normal = D3DXVECTOR3(vNormal);
aoVertices[auiIndices[i + 1]].Normal = D3DXVECTOR3(vNormal);
aoVertices[auiIndices[i + 2]].Normal = D3DXVECTOR3(vNormal);
D3DXVec3Cross(&vCross, &D3DXVECTOR3(v5 - v3), &D3DXVECTOR3(v4 - v3));
D3DXVec3Normalize(&vNormal, &vCross);
aoVertices[auiIndices[i + 3]].Normal = D3DXVECTOR3(vNormal);
aoVertices[auiIndices[i + 4]].Normal = D3DXVECTOR3(vNormal);
aoVertices[auiIndices[i + 5]].Normal = D3DXVECTOR3(vNormal);
しかし、これはグリッド線は、グリッドの正方形の間に表示される原因となっています。 問題は何ですか?
例: