Jump to content
  • Advertisement
Sign in to follow this  
joshlovesbrooke

Brick wall

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

yes...that. i want to draw one. but i only want to have the bitmap of one brick. i have looked for the way to do this all over the internet...and didnt find anything useful to me at ALL any help, (with code, or just a link) would be greatly appreciated

Share this post


Link to post
Share on other sites
Advertisement
textures must be in powers of two with opengl, so keep that in mind with your textures. Check out NeHe's tutorials on texturing, they might help:

http://nehe.gamedev.net/lesson.asp?index=02

You can clamp textures to vetices based on coordinates if you wish. Are you looking for a repeating brick texture? If so, google image search is your answer:

google it

Share this post


Link to post
Share on other sites
yes, i have checked them out, the site is realy aweosme, but i cant find anyhting that would explain how to do what i want to do...i COULD prgram each brick, using vertexs, but umm...that would just take too long for me to do, plus, i think it would kill my program's speed and efficiency (which i will need later)

Share this post


Link to post
Share on other sites
are you talking about having a one brick in a texture tile to make a whole brick wall? If so I don't see how this differs from various tutorials available on texturing.

Share this post


Link to post
Share on other sites
Quote:
Original post by M2tM
are you talking about having a one brick in a texture tile to make a whole brick wall? If so I don't see how this differs from various tutorials available on texturing.


yes, that is what i am talking about. i have not found a site that allows me to do this, all i can do so far is have one brick for the whole wall...i want to know how to repeat the texture multiple times on the same wall..like a brick wall, i dont know if i cant understand what the tutrials are saying, or what.

Share this post


Link to post
Share on other sites
typically you do something like that by using a modeling program (3dsmax, maya, milkshape), saving the model, loading it in your game, and drawing it. The modeling program will do all the vertex/texture assignment stuff for you. Course you have to learn how to use the program...

-me

Share this post


Link to post
Share on other sites
thank you for the link, i used one of their parameters, and it worked, heres the code i made up to isert, it will not be exactly what i use, but its close.

although the website did not tell me where to put this one in, i figured it out:

glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_REPEAT);



after putting that with the other parameters, compiling it, and being dismayed by nothing happening, i made the follow changes:

the old script of one entire brick on the wall was this:


glTexCoord2f(0.0f, 0.0f); glVertex3f(-1.0f, -1.0f, 1.0f);
glTexCoord2f(1.0f, 0.0f); glVertex3f( 1.0f, -1.0f, 1.0f);
glTexCoord2f(1.0f, 1.0f); glVertex3f( 1.0f, 1.0f, 1.0f);
glTexCoord2f(0.0f, 1.0f); glVertex3f(-1.0f, 1.0f, 1.0f);




the new script, with changes, gives me 9 bricks:


glTexCoord2f(0.0f, 0.0f); glVertex3f(-1.0f, -1.0f, 1.0f);
glTexCoord2f(3.0f, 0.0f); glVertex3f( 1.0f, -1.0f, 1.0f);
glTexCoord2f(3.0f, 3.0f); glVertex3f( 1.0f, 1.0f, 1.0f);
glTexCoord2f(0.0f, 3.0f); glVertex3f(-1.0f, 1.0f, 1.0f);





if the website link you gave me showed examples of how to implement its contents, it would be great, but thanks for the link, it helped TONS



EDIT:
i used script [script] instead of source

Share this post


Link to post
Share on other sites
may be you can try glTexSubImage2D(...) function?
I have a instance like you question.
can you show me your E-mail? i will send it to you.
:O)

Share this post


Link to post
Share on other sites
Quote:
Original post by MzW
may be you can try glTexSubImage2D(...) function?
I have a instance like you question.
can you show me your E-mail? i will send it to you.
:O)


adrumsolo4u@hotmail.com

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!