Jump to content
  • Advertisement

Login

Member
  • Content Count

    5
  • Joined

  • Last visited

Community Reputation

100 Neutral

About Login

  • Rank
    Newbie
  1. OK, I found the problem, I made a little mistake in initialize lighting.But thanks for reply
  2. Hi I have got a problem with lights in my OpenGL apllication. I have a models with textures and normals. [attachment=4605:no light no material 2.png] When I turn light on, it's works fine. gl.glEnable(GL10.GL_LIGHTING); //other lights parameters [attachment=4603:light no material 2.png] But I also wanted to use color insted useing material, so I turn ColorMaterial gl.glEnable(GL10.GL_COLOR_MATERIAL); and there is a problem because "light effect" dissapeared, Why ? [attachment=4604:light_and_material 2.png] There are model's screen without lighting [attachment=4605:no light no material 2.png] As you can see model without lighting and model with lighting but with ColorMaterial turned on, are equals Can anyone help me ? Or anybody can give good example with lighting and ColorMaterial turned on? Thanks in advance
  3. so there is no way to use glDrawElements ? I'd like avoid glVertex3f and glTexCoord2f and VBO to make my code a bit compatible with OpenGL ES, so glDrawArray is the only way ?
  4. Hi! I would like to draw simple cube using glDrawElements, glTexCoordPointer . There is part of my code glBindTexture(GL_TEXTURE_2D, texture[0]); glEnableClientState( GL_VERTEX_ARRAY ); // Enable Vertex Arrays glEnableClientState( GL_TEXTURE_COORD_ARRAY ); // Enable Texture Coord Arrays float vertices[] = { 1.0f, 0.0f, -1.0f, //0 index 1.0f, 0.0f, 1.0f, //1 -1.0f,0.0f, 1.0f, //2 -1.0f, 0.0f,-1.0f, //3 1.0f, 1.0f, -1.0f, //4 1.0f, 1.0f, 1.0f, //5 -1.0f,1.0f, 1.0f, //6 -1.0f, 1.0f, -1.0f, //7 }; short indices[] = { 0, 1, 2, 0, 2, 3, 0, 4, 5, 0, 5, 1, }; float texture[] = { 1, 0, 1, 1, 0, 1, 0, 0, //... I repeat these 4 coordinate 2 times 1, 0, 1, 1, 0, 1, 0, 0,}; glVertexPointer( 3, GL_FLOAT, 0, vertices ); // Set The Vertex Pointer To Our Vertex Data glTexCoordPointer( 2, GL_FLOAT, 0, texture ); // Set The Vertex Pointer To Our TexCoord Data glDrawElements(GL_TRIANGLES, 12, GL_UNSIGNED_SHORT, indices); The vertices and indices are show below: [attachment=2315:cube_gamedev.png] I try render bottom and right face of this cube with texture, but only bottom face is textured, as you can see below [attachment=2316:cube_textire.png] Why only bottom face is textured ? I gave texture coordinates for 2 faces. Also if I give more textures coordinates it won't work. Is there another method to draw textured cube using glDrawElements ?
  5. Hi! I would like to changing fullscreen window in my DX9 Application while running. Normally to set fullscreen mode I turn it on by "Windowed = FALSE" in D3DPRESENT_PARAMETERS struct. But I did it while initialize my D3Ddevice. How I can switching between fullscreen mode while running application ? Again creating D3Device with opposite value in "Windowsed" ? Thanks in advance.
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!