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

Thread: Transforming

  1. #1
    Guest

    Transforming

    hey im trying to code a simple tile-based game on OSX..

    ive got to the point where i have:
    -> a window
    -> a white texturemapped rectange in the center

    i want to move to the upper-left corner, draw it, move over, so on... basically if anyone could help me with transforms (i believe thats the term) and how to do tiles.

    THANKS!

  2. #2
    Member Regular Contributor
    Join Date
    Apr 2001
    Location
    Greece
    Posts
    496

    Re: Transforming

    Setup an orthographic projection (glOrtho) where the width and height you pass to it are equal to the width and height of your window. This way each gl unit corresponds to a pixel on the window. Now depending on how you set things up(where the origin is) translate to the desired position and draw your quad. This gets asked a lot so if you search the forums or google for it you should come up with much more info.

Posting Permissions

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