Recommended Posts

Hi all, Is it possible to get a 1:1 pixel:texel ratio using an orthogonal projection matrix, and if so, how? I know I could use transformed vertices to achieve the same thing, but I'd like the flexability of untransformed vertices.
At the moment, I have this:

But that causes my 100x100 triangle to end up 78x78 pixels, and obviously messes up the texture on it.
It's probably something obvious that I'm missing, but I can't seem to see what it is.
Any ideas?
Cheers,
Steve

0

Share this post

Link to post

Share on other sites

Is your window size 1024x768 (or are you running full screen?)? One way you might be able to achieve what you're looking for is to set the ortho projection to 1.0x1.0. Then, use 0 to 1 as the vertices.

float x,y;x = 400.0f;y = 200.0f;float vX = x/1024;float vY = y/768;

Simple example. Sorry if this doesn't help you out. Maybe if you could post more code, the actual setting of vertices for instance, and how you create your presentation params.