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


An MFC/OpenGL Lighting and Materials demo

Recommended Posts

Greetings all, I have posted a demo I''m working on at It''s a Visual C++ 6.0 demo that requires MFC. It''s just one form crammed full of spinner controls that let you control basically every single variable you can send to a lighting or material function. Rendered are a six-colored cube (and you can choose the six colors), two other cubes, a sphere, and an isodecahedron, and you can pretty much move a spotlight around the world, change it back to a directional light, play with the specular, diffuse, ambient, and emissive colors. Also, I have a solid 576x576 plane facing downward, and another that is a 576x576 plane divided into 144*144 squares to illustrate diffuse light - I read in the OpenGL guide that if the vertexes of your polygon are too far away from your light you don''t get much diffuse effect. I''m planning to convert it to a tabbed dialog that repeats each of the light variables for all 8 lights. Special thanks to the folks at - I borrow the CLabel and CNumSpinCtrl controls from that site in this program. I will post the enhanced version when I finish it, for now I wanted to let whoever might be interested in playing around to see how "all of those pieces fit together", and I have the following 3 questions and would appreciate the help: 1. Why do I have a memory leak? I didn''t think I was using malloc anywhere. 2. If you leave the spot cutoff at only 5, you only get a "highlight" on a plane if you''re right on top of it - why is that? 3. I turned everything down to 0 - material, light, specular, diffuse, everything, and there were still faint outlines there - why is that? I would expect total black if everything was set to 0. By all means, if this is of any use to you and there are features you think you''d like to see in the next version, please let me know. I want to *contribute* to this forum, not just leech answers off of it . Thanks everyone! Joe

Share this post

Link to post
Share on other sites