Advertisement

1.0f = how many pixel ?

Started by February 19, 2002 02:04 PM
4 comments, last by dukenukem 23 years ago
when i create a square which one side is 1.0f what is its pixel size?i mean 64 or 128 or 256 or another. i am a newbie.so this question may be weird.sorry for that.
It depends on how you have translated it. if you translate it 20 out, it will be about twice as big as if you had translated it 40 out.
Advertisement
If your projection is orthographic, 1.0f will correspond to a fixed number of pixels (depending on the window size and the projection matrix though).
If your projection is perspective, 1.0f will correspond to a higher number of pixels for close objects, and a lower number of pixels for far objects. (by close or far , I mean close to or far away the camera)
I think it is clear explanation. At least I hope it is.

Edited by - vincoof on February 19, 2002 3:42:03 PM
ok thanks.i''ve understood.
If you want to modify specific pixel locations, look into the glDrawPixels function.
www.EberKain.comThere it is, Television, Look Listen Kneel Pray.
quote:
Original post by Eber Kain
If you want to modify specific pixel locations, look into the glDrawPixels function.

No, please don''t . Setup an orthographic projection matrix and then use glViewport to make screen coordinates equal to pixel coordinates.

This topic is closed to new replies.

Advertisement