Background: To create a mini-solar system with the earth being orbited by satellites. This is the way I approached the problem:
(1) Used Shape Creation Function for Meshes namely D3DXCreateSphere to create the mesh containing a sphere
(2) Used D3DXCloneMeshFVF function to create a duplicate of the mesh with a new vertex format which contains elements for storing texture coordinates
(3) Applied a texture to the sphere
Problem: I wanted to use Exponential Pixel fog to create a foggy effect but I am unable to do so. I used the same code and followed the steps as provided in the SDK C++ Help. . All I get now is the sphere of the same color as I set in the D3DRS_FOGCOLOR and the bitmap is nowhere to be seen.
My doubts: (1) Should I enable pixel fog before or after the DrawSubset() function call to draw the mesh subset when I render the scene? (Both seem to produce the same effect. But what is the logically correct thing to do?)
(2) Why is the textured bitmap that I attached to the spherical mesh not visible when I use Exponential pixel fog?
(3) Could a possible reason for the fog effects not coming out as intended be : If the projection matrix isn't compliant with this requirement, fog effects are not applied properly. (MSDN) If so, how do I make a W-Friendly Projection Matrix??
I am quite unclear about how to do that and can’t seem to find any relevant information on the web.
Please tell me where I could be going wrong. Thanks in advance for your time.
Monzy
(1) Used Shape Creation Function for Meshes namely D3DXCreateSphere to create the mesh containing a sphere
(2) Used D3DXCloneMeshFVF function to create a duplicate of the mesh with a new vertex format which contains elements for storing texture coordinates
(3) Applied a texture to the sphere
Problem: I wanted to use Exponential Pixel fog to create a foggy effect but I am unable to do so. I used the same code and followed the steps as provided in the SDK C++ Help. . All I get now is the sphere of the same color as I set in the D3DRS_FOGCOLOR and the bitmap is nowhere to be seen.
My doubts: (1) Should I enable pixel fog before or after the DrawSubset() function call to draw the mesh subset when I render the scene? (Both seem to produce the same effect. But what is the logically correct thing to do?)
(2) Why is the textured bitmap that I attached to the spherical mesh not visible when I use Exponential pixel fog?
(3) Could a possible reason for the fog effects not coming out as intended be : If the projection matrix isn't compliant with this requirement, fog effects are not applied properly. (MSDN) If so, how do I make a W-Friendly Projection Matrix??
I am quite unclear about how to do that and can’t seem to find any relevant information on the web.
Please tell me where I could be going wrong. Thanks in advance for your time.
Monzy