Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 142823
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T07:59:52+00:00 2026-05-11T07:59:52+00:00

This is for a 2D game so there are only an x and y

  • 0

This is for a 2D game so there are only an x and y axis. The game is in landscape mode on the iPhone. I wish to be able to set the screen x and y coordinates of where to render a texture.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T07:59:53+00:00Added an answer on May 11, 2026 at 7:59 am

    If you’re doing a 2D game, you can set up your projection and model-view matrices so that you don’t need to convert at all:

    // This goes in your init code somewhere // Set up 480x320 orthographic projection glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrthof(-240.0f, 240.0f, -160.0f, 160.0f, -1.0f, 1.0f);  // Rotate into landscape mode glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glRotatef(-90.0f, 0.0f, 1.0f, 0.0f); 

    This makes it so that world coordinates (-240, -160) maps to the top-left of the screen (bottom-left in landscape mode), (240, 160) maps to the bottom-right (top-right in landscape), etc. Since the iPhone’s screen is 480×320, you won’t need to convert between world and screen coordinates with your matrices set up thusly.

    Of course, if you want to be able to move the camera, then you’ll need to offset by the camera’s location.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this game with some variety of textures. Whenever I draw a texture
I guess I'll illustrate with an example: In this game you are able to
In this game im trying to create, players are going to be able to
So I have a player class in my game. Logically there only needs to
I am developing a game for iPhone using OpenGL ES 1.1. In this game,
Well, it's not an error, actually. I have wrote a game. There is only
I have to make a flash game like this: There is a board with
I have this game where balloons are coming from bottom and player has to
I'm making this game where I'm trying to pair people. So I have this
I'm programming this game in OpenGL, mostly working inside an single EAGLView (I'm not

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.