Archived

This topic is now archived and is closed to further replies.

not using the light

This topic is 5572 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites