Advertisement Jump to content
Sign in to follow this  
suckxez

OpenGL Ugly strokes between tiles :(

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

Hi! I'm currently trying to make something like a ISO Map in OpenGL and create a map with following code:
for(float ax=0; ax < MAP_WIDTH; ax++)
{
	for(float ay=0; ay < MAP_HEIGHT; ay++)
	{
		x+= 1;
		y+= 0.5f;
		glBindTexture(GL_TEXTURE_2D, m_Texture.TextureID);
		glBegin(GL_TRIANGLE_STRIP );
			glTexCoord2f(0.0f, 0.0f); glVertex3f(float(x), float(y), 0.0f);
			glTexCoord2f(1.0f, 0.0f); glVertex3f(float(x + 1), float(y - 0.5f), 0.0f);
			glTexCoord2f(0.0f, 1.0f); glVertex3f(float(x + 1), float(y + 0.5f), 0.0f);
			glTexCoord2f(1.0f, 1.0f); glVertex3f(float(x + 2), float(y), 0.0f);
	glEnd();	
		
		if(ay == MAP_HEIGHT-1)
		{
			y=old_y+0.5;
			x=old_x-1;
			old_x = x;
			old_y = y;
		}
	}



Now.. when I'm using a trilinear filter i get ugly strokes: If the Bi/Trilinear filter is turned off, there are not any bothering strokes. But why? Another thing: Do you have any ideas how to create a iso map in a better way? I think my for-loop is a little bit "unesthetic" and bad ;P

Share this post


Link to post
Share on other sites
Advertisement
If you are interested, my library handles 2D Graphics quite well under OpenGL. Feel free to use it, or just peek around at the source.

It's called hxRender, see sig for details.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!