Advertisement

Screen Question!!!! help

Started by March 02, 2002 09:41 PM
3 comments, last by Alpha_Neuron 22 years, 11 months ago
ok, so ive been 2d programmming for a while, so im use to knowing how big, say 5 pixels is, therefore how to plan my environment. But i don''t really get the floating points, i mean, how do i know how long 0.1f is?, what deteremines it and is there any way i can just use pixel lengths, at a certain depth, because i an''t figure how, high to make my walls, of roof, or etc any help will be gratefully appreciaited(cant speel) thanx
I don''t think that''s possible to do, and I don''t see what you want to. A unit in OpenGL doesn''t have a certain length in pixels... it''s just one unit. How tall your walls and things are on screen depends on how many units they are across, and how far the view-point (or camera) is from that wall.

If you want to do pixel-perfect stuff as opposed to 3D vertex stuff, maybe you should stick with 2D programming. Or maybe tell us what your project is so we can get a better idea of what you''re doing.

_________
"Maybe this world is another planet''''s hell." -- Aldous Huxley
_________"Maybe this world is another planet''s hell." -- Aldous Huxley
Advertisement
?? How can you not see what he wants to do? Wtf. He wants to be able to display his bit maps in a way the the screen is divided into pixels rather then by your perspective and such. Like he wants to display a bitmap at screen position (3,23) or something.

I would not recommend openGL for this. I remember trying to do it and figured out a way. I''ll get back to you if i think of any thing.
Alpha_Neuron ...

Are you trying to do 3D stuff or 2D stuff? The fact that you mentioned depth, implies 3D. If that is the case, why on earth would you want to measure in pixels? Because if you are, what happens when a user changes screen resolution? Also, if an obect (a wall) say 10 pixels high is drawn, and you moved back by a certain distance, how big would you draw it then? Maybe you''ll begin to see the point of floats - perhaps when you moved back the wall ''should'' be 7.5 pixels high to maintain proper perspective. Try abstracting yourself from the idea of pixels, and just think in terms of units. Of course a unit is whatever you want it to be. You could say 1 unit = 1 meter, or 1 unit = 1,000,000 kilometers. it makes no difference as long as you stick to it for other objects etc.

But really, we need more info on what you are trying to do.
Thanx for your replys,

i kind of got the 3d thing, i just needed a little bit of experience.

thanx

This topic is closed to new replies.

Advertisement