not using the light
Hiya, I just worked my way through "loading a mesh" tutorial
but when I draw the mesh it doesn''t show it, now my guess is it''s because I didn''t set a light
my question now is do I have to set up a light, or can I ask dx to show my mesh without using a light?
If lighting is enabled, you can disable it using the SetRenderState function:
pDevice->SetRenderState(D3DRS_LIGHTING, FALSE);
If you still can''t see your mesh, make sure it''s in view (and large enough to see), your project transformation is right, and you''re properly rendering each subset of the mesh. Also, make sure to clear the zbuffer before rendering any meshes (if you are using depth buffers, that is).
Jim Adams
home.att.net/~rpgbook
Author, Programming Role-Playing Games with DirectX
and Focus On: Advanced Animation with DirectX
pDevice->SetRenderState(D3DRS_LIGHTING, FALSE);
If you still can''t see your mesh, make sure it''s in view (and large enough to see), your project transformation is right, and you''re properly rendering each subset of the mesh. Also, make sure to clear the zbuffer before rendering any meshes (if you are using depth buffers, that is).
Jim Adams
home.att.net/~rpgbook
Author, Programming Role-Playing Games with DirectX
and Focus On: Advanced Animation with DirectX
quote:Original post by Da cobra
Hiya, I just worked my way through "loading a mesh" tutorial
but when I draw the mesh it doesn''t show it, now my guess is it''s because I didn''t set a light
my question now is do I have to set up a light, or can I ask dx to show my mesh without using a light?
Never clear your screen to black. Many things cause triangles to be drawn as black, eg. no normals when you turned lighting on (the default). Always blank to eg. blue when testing and debugging.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement