• Advertisement

Archived

This topic is now archived and is closed to further replies.

viewport

This topic is 5956 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

i use GLviewport(0,0,height,width); i would like to know number of pixel / 1 length on opengl example glbegin(GLpolygon) GLvertex2f(0,0); GLvertex2f(0,1); glend; i would like to know length of line(in pixel) of this polygon.

Share this post


Link to post
Share on other sites
Advertisement
correct me if i''m wrong but wouldn''t that draw a line one pixel long? and depending on the viewport, it''ll LOOK like it''s bigger or smaller but it''s still only 1 pixel, isn''t it?

- Mike

Share this post


Link to post
Share on other sites
no
it ''s bigger than 1 pixel; (almost 10 pixel)
i would like to know its size (in pixel).
because i will map picture to view port of opengl.
For Example

i have one picture(Height=200,width=200).
i will draw this picture to screen of opengl.
How do i do?

thank you


Share this post


Link to post
Share on other sites
Well... There is one problem with this... there really isn''t a fixed size for that so called "1 length" it really depends on the screen resolution you are using... However you can calculate it by retrieving the Perspective Matrix that OpenGL uses and perform some math on that... there is one other thing though... the z-depth is also a factor for the length of the line...

Fortunately OpenGL supports a mechanism for you to create a so called Orthographic matrix... which you can give your own coordinate system, then map the textured quads on it and it will work in every thinkable way. (So just set up an Orthographic Perspective Matrix in OpenGL)

I hope this was of any help... however if you remain really stuck with the problem contact me:

ICQ 130925152
Email e.j.folkertsma@student.utwente.nl or mitolah@hotmail.com

Dark



Share this post


Link to post
Share on other sites
orthographic projection matrix... orthographic perspective is an oxymoron.

sorry... just had to set that straight... little things like that bug me to death sometimes

Share this post


Link to post
Share on other sites

  • Advertisement