Re: [Algorithms] 2D in a 3D world
Brought to you by:
vexxed72
From: Matt J <mjo...@gm...> - 2010-08-08 19:01:12
|
Another thing to check for is how you are loading the texture..e.g. if you are using something like D3DXCreateTextureFromFileEx make sure it isn't rounding something to the nearest power of 2, e.g. use *D3DX_DEFAULT_NONPOW2 * to prevent that... and check that you aren't using a filter e.g. use * D3DX_FILTER_NONE* The aspect ratio of the orthogonal matrix (e.g. width/height) needs to match > the aspect ratio of the viewport...otherwise you get stretching.. not sure > if that is the issue.... > > If you are creating an orthogonal matrix that ranges from -0.5 to 0.5 for > left and right planes, you need to multiply the -0.5 and 0.5 by 0.5859375 > (600/1024) for the bottom and top planes to account for the aspect ratio. > Maybe you are, but you didn't mention that. > > If this part isn't right, it could mess up how your adding the half texel > offset to y as well. Just a hunch, I didn't try doing the math. > > Matthew > > |