Skip to main content
gamedev.net
🔒 Locked

Texture Coordinates

Started by Badone Jan 6, 2002 at 3:04 PM 2 replies 150+ views
Original Post
Badone
Badone
Does anyone have an example of texture coordinates or know a place that does? I have searched and searched through the forums, msdn, and google and all I have found is it showing something with vertices but I don''t have vertices in my game at all. I''m using dx8 with D3DXSprite and I''m trying to get a piece of an image to be put on the screen. I''m doing a tile engine. Thanks!
BenHanson
BenHanson
http://www.msdn.microsoft.com/library/default.asp?url=/library/en-us/dx8_c/directx_cpp/Graphics/ProgrammersGuide/UsingDirect3D/Textures/Coordinates/TextureCoordinates.asp
"All programmers are playwrights and all computers are lousy actors." -Anon.
Badone
Badone
I read through that and saw the vertices. But can I get some help on how I use the vertices? The program I have now has no vertices at all. It doesn''t use surfaces, just a directx8 device and d3dxsprite with the d3dxcreatetexturefromfile and d3dxsprite->draw functions.
CaptainJester
CaptainJester
I haven''t tried it yet, but as I understand it, you must draw polys, then apply your sprite as a texture to the poly. There is an article on this site here that explains some of it. There are also articles on Flip Code about this as well. Basically you are using 3D, but telling Direct3D that the vertices you are supplying are already transformed to screen coordinates. You then create to triangles that come together to form a rectangle and apply a texture to it. This is what is called a textured quad.

---
Make it work.
Make it fast.
"None of us learn in a vacuum; we all stand on the shoulders of giants such as Wirth and Knuth and thousands of others. Lend your shoulders to building the future!" - Michael Abrash[JavaGaming.org][The Java Tutorial][Slick][LWJGL][

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.