Jump to content

  • Log In with Google      Sign In   
  • Create Account

viewport


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 nipon   Members   -  Reputation: 122

Like
Likes
Like

Posted 02 October 2001 - 08:08 AM

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.

Sponsor:

#2 mkaltner   Members   -  Reputation: 122

Like
Likes
Like

Posted 02 October 2001 - 08:54 AM

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

#3 nipon   Members   -  Reputation: 122

Like
Likes
Like

Posted 02 October 2001 - 10:05 PM

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




#4 Dark   Members   -  Reputation: 122

Like
Likes
Like

Posted 03 October 2001 - 06:04 AM

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





#5 Bad Monkey   Members   -  Reputation: 145

Like
Likes
Like

Posted 04 October 2001 - 12:31 AM

orthographic projection matrix... orthographic perspective is an oxymoron.

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




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS