Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

122 Neutral

About eroy4u

  • Rank
  1. i put a spotlight over a table drawn by the code below but it cannot illuminate the table, but it can illuminate a sphere on the table, how come? can someone help, thanks. //draw the table glTexImage2D(GL_TEXTURE_2D, 0, 3, texTable_w, texTable_h, 0, GL_RGB, GL_UNSIGNED_BYTE, texTable); glBegin(GL_POLYGON); glNormal3f(0.,1.,0.); glTexCoord2f(0.0,0.0);glVertex3f(-TABLEHWIDTH,0.,-TABLEHLENGTH); glTexCoord2f(1.0,0.0);glVertex3f(TABLEHWIDTH,0.,-TABLEHLENGTH); glTexCoord2f(1.0,1.0);glVertex3f(TABLEHWIDTH,0.,TABLEHLENGTH); glTexCoord2f(0.0,1.0);glVertex3f(-TABLEHWIDTH,0.,TABLEHLENGTH); glEnd(); //setting for the light: GLfloat light_amb0[] = {10.0, 0.0, 0.0, 1.0}; GLfloat light_pos0[] = {0.0f, 8.0f, 0.0f, 1.0f}; GLfloat light_dir[] = {0,-1, 0}; GLfloat angle=45; glLightfv(GL_LIGHT0, GL_AMBIENT, light_amb0); glLightfv(GL_LIGHT0, GL_POSITION, light_pos0); glLightfv(GL_LIGHT0, GL_SPOT_CUTOFF, &angle); glLightfv(GL_LIGHT0, GL_SPOT_DIRECTION, light_dir);
  2. problem solved after updating display driver, thanks every body
  3. I just draw a textured rectangle and a textured sphere it becomes very slow just about 4 frames per second even in the full screen mode? it opengl really so slow or my computer that matters? my display card is Geforce MX 440, i'm writing a mini-game in 3D, but if opengl's really so slow, should i switch to using directx? thank you.
  4. I want to map the 2D mouse coordinates with 3d coordinates in the game world: GLdouble objX,objY,objZ; GLdouble model, proj;GLint view; glGetDoublev(GL_MODELVIEW_MATRIX,&model); glGetDoublev(GL_PROJECTION_MATRIX,&proj); glGetIntegerv(GL_VIEWPORT,&view); gluUnProject(mouse_x ,mouse_y , 1 ,&model,&proj,&view, &objX , &objY , &objZ ); it says error and cause the application to stop how come, can anyone help? thanks
  5. I have two class, e.g. cClass1 and cClass2, cClass1 has some manipulation on cClass2 and vice versa. So I try to include cClass2 in cClass1 and include cClass1 in cClass2. however, when I do these two steps at the same time, error occur seems they include nothing how come? Please help. Thank you.
  6. eroy4u

    2D Drawing in Direct3D

    I've tried texture quads but i see the image is blurred? how can i solve it?
  7. I'm making a 2D game with directx 9.0. I have read some of the articles concerning 2D Drawing in Direct3D. Some say use texture, some say use Sprite, It seems using sprite is easier then i dun understand why to use texture? thx
  8. o it is ok la now,Thank you. but i wanna ask what is the meaning of glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
  9. is it the " glEnable(GL_DEPTH_TEST);"? but after i set it the whole screen is black, everything disappears how can I use it?
  10. I draw several spheres and torus by opengl in 3D world but the last drawn one is alawys on the top of others(i.e. NOT blocked by the objects in front of it) They are just like objects in 3D world, how can I view as they are in actual world?
  • 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!