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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T12:43:04+00:00 2026-05-29T12:43:04+00:00

I am drawing some points in an array using glVertex2f(), and I need to

  • 0

I am drawing some points in an array using glVertex2f(), and I need to flip it upside-down. I am drawing it in a glViewport(), so I can resize it and move it around. But I don’t know how to flip it.

Do I have to use gluOrth2d()? I don’t fully understand what the difference is between gluOrth2d() and glViewport() and when to use which.

  • 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-29T12:43:06+00:00Added an answer on May 29, 2026 at 12:43 pm

    glViewport() sets the viewport. That is it sets what part of the window your whole geometry will be drawn in. Notice that it accepts integers(!!) and not floating point numbers just because we need to be exact to the part of the screen where the rendering will occur.

    gluOrtho, like gluPerspective, glFrustrum e.t.c. is used to set the Projection Matrix.

    Please note that even though you may not be using gluOrtho2D() in your program you should be using since you always need to have a perspective projection set by yourself.

    EDIT: (corrected to comply with the pointers given in the comments)

    In order to flip the whole scene, assuming it is 2D you could do this

    glScalef(1,-1,1);
    

    which will multiply the current modelview matrix with a scaling matrix, effectively flipping the scene upside down.

    Since you seem to need help with understanding the use of openGL matrices I want to provide these two links that I hope might help:

    Explains without lots of math

    Explains with a bit more math

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

Sidebar

Related Questions

I have developed application for drawing some shapes (lines mostly) , now i need
In my WPF application I have some drawing functionality. I have solved this using
In VB.NET I'm drawing an ellipse using some code like this. aPen = New
I am using OpenGL/GLUT to implement Bresenham's line drawing algorithm and having some issues
I want to create an static drawing (say any animals like giraffe) using some
I have an array that contains the points for drawing multiple hills. When I
I am drawing some curves inside canvas. After the curve is complete, I need
I'm drawing some 2D lines in OpenGL (using the AGL API). I've turned on
I'm drawing some UML in which a concrete class inherits from an abstract class
I have recently focused on drawing some cool shapes in a HTML 5.0 canvas.

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.