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 3 of 3

Thread: vertex's route from scene to screen (and sorry for my bad english)

  1. #1
    Junior Member Newbie
    Join Date
    Jan 2004
    Location
    Wroclaw,Poland
    Posts
    2

    vertex's route from scene to screen (and sorry for my bad english)

    h!
    i have to write simple software 3d renderer and i want to do it in opengl way (without matrix stack so far), so i've go two matrices: projection and modelview, opengl keeps matrices in column-major order. all transformations are done (as i think) this way: M' = M * transform_matrix which is transposed (to be in column-major order)
    so, let's imagine some object in local his coordinates. after multiplying by modelview matrix we'll have this object with world coordinates (am i right?)
    so there is my first problem: how to do it (multiply) correctly (or how it's done by OpenGL)?
    'v = M * v ? or maybe the are any transpositions/inversions needed (to matrix)?
    after that, we have to project vertex on the screen (and i'm afraid it's more complicated)
    and to be honest i don't understand exactly what to do.
    i've got projection matrix (exact like after glFrustum or glOtho) and i have to multiply (yeah, same problem, is it the same situation ?)
    after that, i have to (as i think) normalize (but how exactly?) these coordinates to screen coordinates (ok, i can do it like glViewport), but somethere i've found some dividing by w viewpoint' and i don't know what to do with it and where (after which step) to do it

    please help

    (do i have to add any clipping to triangle fill routine?)

    thx for you attention
    /maciek

  2. #2
    Intern Newbie
    Join Date
    May 2003
    Location
    Bucharest,Romania
    Posts
    40

    Re: vertex's route from scene to screen (and sorry for my bad english)

    Get the opengl 1.5 specifications from the front page of opengl.org. You'll find all those transformations explained there

  3. #3
    Junior Member Newbie
    Join Date
    Jan 2004
    Location
    Wroclaw,Poland
    Posts
    2

    Re: vertex's route from scene to screen (and sorry for my bad english)

    Originally posted by fuxiulian:

    Get the opengl 1.5 specifications from the front page of opengl.org. You'll find all those transformations explained there
    I think this is it.
    I've missed normalization - this one can explain this dot on the center of the screen

    thx a lot
    /maciek

Posting Permissions

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