Jump to content
  • Advertisement
Sign in to follow this  
Trent Linton

Trouble Understanding Textures in OpenGL

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

I am trying to texture a Mini Maze in OpenGL using a bunch of hard coded wire cubes, but I don't Understand how to get it to display on the faces of the cube and not display in between each connected cube so it looks like a long hallway.

//Map for Maze
//....................Finish..............
//......................{F}.................
//......................[6]..................
//......................[5]..................
//..

[8][9][0][1][4][1][0][9][8]


//......[7]............................[7]...
//......[6]............................[6]...
//......[5]............

............[5]...
//..

[4][3][2][1][3][1][2][3][4]


//......................[2]................
//......................[1].................
//......................{S}................
//....................Start..............

Share this post


Link to post
Share on other sites
Advertisement
I'm not sure if I understand you correctly, but if you mean that you want your hall to look like it is one seamless texture, you can do either of these 2:

Create a texture that is tileable, so the end of one part is the beginning of the new part of your blocks texture.

Or manage your UV coordinates to go over the span of an X amount of blocks.

Share this post


Link to post
Share on other sites
I don't care if it's seamless for now, because I'm just trying to get a different texture applied to the "walls", "ceiling", & "floor". It won't be until after I can get it to work will I worry about the look of it.

My original post May have been a little unclear, I have no idea how to get texture to display in the manner I am asking, probally because I've never work with OpenGL texture stuff before. I understand the how it works, but I can't get it to work

Share this post


Link to post
Share on other sites
What have you tried?

There are resources online (such as NeHe) and offline (such as the OpenGL Programming Guide) that explain it rather well.

Share this post


Link to post
Share on other sites
Ah right, you're looking for "per face material/textures" than? if you create the geometry yourself you might want to just create individual planes and apply the texture to that and construct those in a box.

Eventually, you will most likely want to add some more complex geometry and perhaps create a modelloader of some format.

Anyway, as frob already mentioned. Nehe (and plenty others) have some good tutorials that can help you get on track.

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!