• Advertisement

Archived

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

Gah! Texture problem

This topic is 5510 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

For some reason, the texture in this code does not properly show. It gets mapped out in a radial pattern, like spokes in a wheel almost. Any ideas? It''s driving me insane.
GLvoid BuildMapList()
{
 int xloop, yloop;
 glLoadIdentity();
 GLfloat floatx, floaty, floatxB, floatyB;
 MapList=glGenLists(1);
 glBindTexture(GL_TEXTURE_2D, texture[0]);
 glNewList(MapList,GL_COMPILE);			// New Compiled box Display List
  //glBegin(GL_QUADS);
  glBegin(GL_LINES);
   for (xloop=1;xloop     

			
		

Share this post


Link to post
Share on other sites
Advertisement
Hi !

Not sure, but you''re trying to apply a 2d texture on a terrain, right ?
I guess you should be using glTexCoord2f(floatx, floaty) once per vertex (before each glVertex3f statement).

BTW, you should consider using triangle strips instead of quads.

Share this post


Link to post
Share on other sites
Reading the code, textures, quads and colars are in commentary so they won't be compiled. I think the right code should be like:

glVertex3f(float(xloop/xyScale),float((yloop+Detail)/xyScale),float(hmap(xloop,yloop+Detail)/zScale));

glVertex3f(float(xloop/xyScale),float(yloop/xyScale),float(hmap(xloop,yloop)/zScale));

glVertex3f(float((xloop+Detail)/xyScale),float((yloop+Detail)/xyScale),float(hmap(xloop+Detail,yloop+Detail)/zScale));

glVertex3f(float((xloop+Detail)/xyScale),float(yloop/xyScale),float(hmap(xloop+Detail,yloop)/zScale));


Note that I only use LINES just for wireframe so I may mistake as I don't know to texture them yet.


[edited by - Luya on January 22, 2003 1:51:05 PM]

Share this post


Link to post
Share on other sites
thanks rod.

I''m not concerned about the performance issues of using quads, This project wont be used for anything off this system.

Share this post


Link to post
Share on other sites

  • Advertisement