   Direct3D Questions for 2D - Sprite Frames and Screen Coords
  I have two questions for Direct3D for 2D graphics. Please note that I am only just beginning to start 3D programming and Direct3D, so I'm not too savy on many a topic.1) Is there some way to apply only a section of a texture, instead of having to create multiple textures using locking and unlocking, like IDirectDrawSurface::Blit and source/destination rectangles? I am using the Blit function from the tutorial Dissecting Sprites in Direct3D2) I thought I remembered (when I had examined some tutorials here) some sort of flag in the initialization of Direct3D that made it to where the coordinates were screen coordinates, instead of having to calculate what a screen coordinate would be in the floating-point coordinate system. Is there actually such a flag that eliminates that extra calculation, or do I have to do it manually?Please correct my errors, numerous as they may be.   
  1) To apply only portions of a texture simply use fractions for the float value. Like if you wanted to start half way accrossa texture make the left hand x valued 0.5 etc.2) You have to tell D3D not to transform the vertices by the world matrix and this is done by doing the following:// SIMPLE 2D COORDINATEstruct _2D_COORD{float x, y, z, rhw;// positions, rhw (1 for pretransformed)float u, v;// texture coordinates;};// Appropriate vertex declaration#define D3DFVF_TRANSTEXT (D3DFVF_XYZRHW|D3DFVF_TEX1)Thats an example vertex struct.The coordinates are floats and their values are the locations on the back buffer x-pixels by y-pixels.Hope this helps,ace   ;  Thanks for the reply.So the fractional coordinates would belong in the variables "u" and "v"? This what he (author of the article) has when structuring a quad:D3DTLVERTEX vertices[4] ={ // x, y, z, rhw, colour, tu, tv { left,  top, z, rhw, colour, 0, 0 }, //It's the last two, right? { right, top, z, rhw, colour, 1, 0 }, { right, bottom, z, rhw, colour, 1, 1 }, { left,  bottom, z, rhw, colour, 0, 1 } };Also, for the vertices, the author of "Dissecting Sprites in Direct3D" uses a whole bunch of complex (to me) computations dealing with matrices and stuff like that... Why does it need a matrix when it's only two-dimensional?Sorry if I'm being somewhat difficult.EDIT: Ah, you were right about the portion coordinates. Thanks.EDIT (AGAIN): I'm starting to see, now that I can actually think (yay Dr. Pepper!), what the transformations and such do. Probably need to look at it some more.Thanks for your help.However, I have one more question: When exactly do I need to be sure to keep a texture that's dimensions are a power of two? His (the author again) sprite's size is 32x40 and it doesn't seem distorted or fuzzy at all...   ;  From my experience i can tell you there is nothing complicated about gett quads in 2D, u simply set the RHW values to 1 so that the xyz values are not transformed by the world matrix   ;  Thanks. (Rating++)NOTE: Had a question, then figured out how stupid it was.   ;  Well if you dont understand just ask anyhoo :P :Dace   