How do you map a texture to a quadrilateral when the shape is not square or rectangular because I am doing a 3D game
Thanks
How do you map a texture to a quadrilateral when the shape is not square or rectangular because I am doing a 3D game
Thanks
You simply give each vertex a set of texture coordinates and then that will be used to map the texture onto your object.
"...the results are undefined, and we all know what "undefined" means: it means it works during development, it works during testing, and it blows up in your most important customers' faces." --Scott Meyers
Can you give me an example in code
All right, I thought this might happen. What API are you using? Then maybe I can help you a bit more.
"...the results are undefined, and we all know what "undefined" means: it means it works during development, it works during testing, and it blows up in your most important customers' faces." --Scott Meyers
My API is Dev C++ if that helps
no, what are you using to render the texture mapped quad? Direct3D/DirectDraw, OpenGL, software rasterizer?
Open GL
Go take a look at www.gametutorials.com under there OpenGL section. They have a tutorial for texture mapping a quad, and then it shouldn't be hard for you to apply the concept to 3D models.
"...the results are undefined, and we all know what "undefined" means: it means it works during development, it works during testing, and it blows up in your most important customers' faces." --Scott Meyers