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 6162089
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T21:35:36+00:00 2026-05-23T21:35:36+00:00

I am trying to map a 2D image to a quad as a background

  • 0

I am trying to map a 2D image to a quad as a background image. The image is drawn at the center of the screen so it ends up only covering the top right quater with the rest going offscreen. Is there anyway I can translate or change the TexCoord so it wil draw from the bottom left? Below is the code I am using.

        background.bind();          
        GL11.glBegin(GL11.GL_QUADS);
             GL11.glTexCoord2f(1,1);
             GL11.glVertex2i(0,0);
             GL11.glTexCoord2f(1,0);
             GL11.glVertex2i(0,600);
             GL11.glTexCoord2f(0,0);
             GL11.glVertex2i(800,600);
             GL11.glTexCoord2f(0,1);
             GL11.glVertex2i(800,0);
        GL11.glEnd();
  • 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. Editorial Team
    Editorial Team
    2026-05-23T21:35:37+00:00Added an answer on May 23, 2026 at 9:35 pm

    This has nothing to do with textures; if you took your texture away, it would render exactly the same as it does now.

    OpenGL does not naturally take vertices in window coordinates. In order to allow it to do so, you generally need to set up an orthographic projection matrix of some form, typically with glOrtho. This would look something like:

    glMatrixMode(GL_PROJECTION);
    glPushMatrix();
    glLoadIdentity();
    glOrtho(0, width, 0, height, -1.0, 1.0);
    
    glMatrixMode(GL_MODELVIEW);
    glPushMatrix();
    glLoadIdentity();
    
    //Render stuff in window coordinates here.
    
    glPopMatrix();
    
    glMatrixMode(GL_PROJECTION);
    glPopMatrix();
    

    The matrix pushing and popping ensures that the prior matrix is preserved.

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

Sidebar

Related Questions

I am trying to create a wpf control that will display a map image
I'm trying to figure out if this is possible.. I have an image map
I'm trying to use jQuery to dynamically create an image map, and I ran
I am trying to create network map on c# like on this image I
I am trying to get the map to fill in only the upper half
i'm trying to modify a image, which is casted from a String: [Embed(source='map.swf', symbol='wZero')]
I'm using the ImageSnapshot.captureImage() method to screen capture a map image which is 2305
i'm trying to get a link from a image map to change selected item
I'm trying to do actions on mouseover of an image map area. Here is
I'm trying to disable an image map onClick - and eventually I'd like to

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.