• Advertisement

Conqueran

Member
  • Content count

    31
  • Joined

  • Last visited

Community Reputation

139 Neutral

About Conqueran

  • Rank
    Member
  1. Lighting and Texturing

    Thanks for the link :). I replaced GL_DECAL with GL_MODULATE
  2. I'm stumped on this one.. I've finally added texturing to one of my objects, but the lighting no longer effects it! This is what I have glBegin(GL_QUADS); glNormal3f(0, 1, 0); float dcolor[] = { 0.0f, 1.0f, 0.0f, 1.0f }; glMaterialfv(GL_FRONT, GL_DIFFUSE, dcolor); glTexCoord2f(0.0, 0.0); glVertex3f(5, 0, 8); glTexCoord2f(0.0, 3.0); glVertex3f(5, 0, -4); glTexCoord2f(2.5, 3.0); glVertex3f(-5, 0,-4); glTexCoord2f(2.5, 0.0); glVertex3f(-5, 0, 8); glEnd(); The reflected diffuse color doesn't seem to do anything, however, without the texturing it works fine.. Anyone know what might be happening?
  3. Problem with Submenus

    Thanks. Everything works smoothly now :)
  4. Proper Lighting of a Sphere

    yes I didn't have a depth buffer.
  5. I tried setting up fog in my scene using the Nehe tutorial.. However all I see is everything becomes dark.. I don't see a fog effect at all. Everything just becomes black..! Does anyone know what might be happening?
  6. I'm creating a POP-UP menu in my window using the following code.. HMENU hmenu, ShadowMenu, ShadedMenu, LightingMenu; hmenu = CreatePopupMenu(); ShadowMenu = CreatePopupMenu(); ShadedMenu = CreatePopupMenu(); LightingMenu = CreatePopupMenu(); InsertMenu(ShadowMenu, 0, NULL, 2000, "Yes"); InsertMenu(ShadowMenu, 1, NULL, 2001, "No"); InsertMenu(ShadedMenu, 0, NULL, 3000, "Flat"); InsertMenu(ShadedMenu, 1, NULL, 3001, "Smooth"); InsertMenu(LightingMenu, 0, NULL, 4000, "Spotlight"); InsertMenu(LightingMenu, 1, NULL, 4001, "Point"); InsertMenu(hmenu, 0, NULL, 1000, "Default View Point"); InsertMenu(hmenu, 1, NULL, 1001, "Fog Options"); InsertMenu(hmenu, 2, NULL, 1002, "Texture Mapping" ); InsertMenu(hmenu, 3, MF_POPUP, (UINT_PTR)ShadowMenu, "Shadow" ); InsertMenu(hmenu, 4, NULL, 1004, "Blending Shadow" ); InsertMenu(hmenu, 5, NULL, 1005, "Quit" ); InsertMenu(hmenu, 6, NULL, 1006, "Wire Frame" ); InsertMenu(hmenu, 7, MF_POPUP, (UINT_PTR)ShadedMenu, "Shading" ); InsertMenu(hmenu, 8, MF_POPUP, (UINT_PTR)LightingMenu, "Lighting" ); I inserted all this in my WndProc at the beginning (probably a lame place to put it.. I then use case WM_CONTEXTMENU: TrackPopupMenu(hmenu, NULL, LOWORD(lParam), HIWORD(lParam), 0, hWnd, NULL); break; to load the menu... The submenu works fine after the first couple or so tries, but at one pt the submenu doesnt show at all! and it doesnt show until I restart the program.. Sometimes the submenu works for 10 times, sometimes it stops showing after only 2 times! How can I make it so the popup menu shows up ALL THE TIME? I wonder why it stops working? Does anyone know whats going on?
  7. Proper Lighting of a Sphere

    hey I culled the back faces and it came out correctly... Thanks :)... I still need to learn a bit apparently ... THANK U SO MUCH... damn I'm happy it works/.
  8. Proper Lighting of a Sphere

    I tried inverting the normal.. The sphere points are held in a data file, I simply draw the polygons from the data file and calculate the normals for each.. I tried normalizing the vectors myself, I get the same result. A depth buffer problem? I'm not sure what u mean by culling back surfaces.. Brian
  9. I'm trying to properly light a sphere made up of several polygons.. I set the normals of all polygons and yet I get this wierd effect. I can see the inside of my sphere! parts of it light up correctly, but I see the inside of it at parts and its black.. I'd post a picture but I don't know how to post pictures on the forums... Has anyone experienced this before? If so, what is happening? I know my normals are set correctly and I used glEnable(GL_NORMALIZE) to make sure they are unit vectors, so what can be going wrong?
  10. I'm trying to use global ambient to light my scene. glEnable( GL_LIGHTING ); GLfloat global_ambient[] = { 1.0f, 1.0f, 1.0f, 1.0f }; glLightModelfv(GL_LIGHT_MODEL_AMBIENT, global_ambient); however nothing lights up... It's all dark.. What is going on?
  11. Creating a submenu within a Pop-up menu

    I tried this but I get the following error. HMENU hmenu, ShadowMenu; //set up pop-up menu hmenu = CreatePopupMenu(); ShadowMenu= CreatePopupMenu(); InsertMenu(hmenu, 0, NULL, 1000, "Default View Point"); InsertMenu(hmenu, 1, MF_POPUP, ShadowMenu, "Fog Options"); InsertMenu(hmenu, 2, NULL, 1002, "Texture Mapping" ); ............ .......... .......... ........... 'InsertMenuA' : cannot convert parameter 4 from 'struct HMENU__ *' to 'unsigned int'
  12. Creating a submenu within a Pop-up menu

    I've tried this but I ran into, unhandled exception errors.. plus it seems waaaay too hard.. I could be wrong.
  13. I'd like to create a submenu within a popup menu using c++. I have this so far HMENU hmenu; //set up pop-up menu hmenu = CreatePopupMenu(); InsertMenu(hmenu, 0, NULL, 1000, "Default View Point"); InsertMenu(hmenu, 1, NULL, 1001, "Fog Options" ); InsertMenu(hmenu, 2, NULL, 1002, "Texture Mapping" ); InsertMenu(hmenu, 3, NULL, 1003, "Shadow" ); InsertMenu(hmenu, 4, NULL, 1004, "Blending Shadow" ); InsertMenu(hmenu, 5, NULL, 1005, "Quit" ); InsertMenu(hmenu, 6, NULL, 1006, "Wire Frame" ); InsertMenu(hmenu, 7, NULL, 1007, "Shading" ); InsertMenu(hmenu, 8, NULL, 1008, "Lighting" ); This creates a menu with 9 different items... However I want the "Fog Options" choice to be a menu itself! When its selected I'd like a new menu to show to the right.. Just like windows does with menus often.. How do I do this using InsertMenu?
  14. Adding a pop-up menu to a window.

    Lol I thought I didn't need any more help... I've been using InsertMenu to insert different things into my HMENU. However what if I want to insert another HMENU!? like a submenu within a popup menu... Anyone know?
  15. Adding a pop-up menu to a window.

    Thanks too everybody for their help! I finally got the hang of it! I'm very happy I have a board like this to get help from, THANKS AGAIN .
  • Advertisement