Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 4 of 4

Thread: ? Z buffer misunderstanding ?

  1. #1
    Intern Newbie
    Join Date
    Mar 2005
    Posts
    41

    ? Z buffer misunderstanding ?

    I'm confused. I have a texture that is 64x64 and one that is 512x512. When I draw both of them at the same z coordinate, they are the SAME size!?? Is that normal? Shouldn't my 512x512 be alot bigger than the 64x64?

  2. #2
    Advanced Member Frequent Contributor
    Join Date
    Feb 2006
    Location
    Sweden
    Posts
    748

    Re: ? Z buffer misunderstanding ?

    no, just more detailed.
    Texture size has nothing to do with how much space it will take up on the screen since the texture coordinate system goes from 0 to 1.

  3. #3
    Intern Newbie
    Join Date
    Mar 2005
    Posts
    41

    Re: ? Z buffer misunderstanding ?

    Let's say I have a enemy character that is supposed to be 2 times larger than my main character in a game, How would I proportionately show them according to their positions on the z axis?

  4. #4
    Junior Member Regular Contributor
    Join Date
    Jul 2005
    Location
    Berlin, Germany
    Posts
    188

    Re: ? Z buffer misunderstanding ?

    The size of an object is defined by the position of it's vertices (the glVertex* calls) and the transformations (modelview and projection matrix) at the time it is drawn.

    To make an object twice as big as another one, either use vertex positions twice as large, or apply a scaling transformation to one of the objects (glScalef(2, 2, 2) for the larger one, for example).
    355/113 -- Not the famous irrational number PI, but an incredible simulation!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •