Thread: OpenGL doubts

    #1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    75
    Rep Power
    2

    OpenGL doubts


    As a beginner in openGL I am having various doubts. Hope this is the right place.

    1) in openGL there is a funciton gluperspective which allows us to set the clipping plane. In sample codes, its value is usually 0.1. What does this mean?

    2) What are the range of values of vertices? I think my computer has 1024 * 1080 pixels. Then why vertices are usually small like (0.5, 1, -2).

    3) Why having z coordinate = 0 doesn't show anything? 0 means it's on the screen right? Then it should show something!

    Thank you!
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2014
    Location
    Southampton UK
    Posts
    15
    Rep Power
    0
    Originally Posted by Avichal
    1) in openGL there is a funciton gluperspective which allows us to set the clipping plane. In sample codes, its value is usually 0.1. What does this mean?
    The front clipping plane is at 0.1, simple as that.

    Originally Posted by Avichal
    2) What are the range of values of vertices? I think my computer has 1024 * 1080 pixels. Then why vertices are usually small like (0.5, 1, -2).
    You don't understand view matrices.
    Please take the time to read a few tutorials on the perspective view. The coordinates are relative to the centre of the object and have no direct relationship with screen pixels.

    A vertex goes through several transformations before it hits the screen.

    Typically the vertex is rotated to match the orientation of the object, translated to the location of the object, transformed into camera space, then transformed into screen space.

    Only then can you know a pixel location for a vertex.

    3) Why having z coordinate = 0 doesn't show anything? 0 means it's on the screen right? Then it should show something!

    Thank you!
    No, in a perspective view, 0 is in front of the front clip plane and therefore CLIPPED.

    Please just do some reading about transformation matrices and view coordinate systems. It's not a complex subject once you get your head around it and once you do everything will just make sense.

IMN logo majestic logo threadwatch logo seochat tools logo