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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:26:40+00:00 2026-05-26T07:26:40+00:00

I would like to reposition a circle, triangles, lines and an arc. How do

  • 0

I would like to reposition a circle, triangles, lines and an arc. How do I go about it? I’ve searched the web for solutions but nothing that address the issue specifically.

Any input that will lead me in the right direction will be helpful.

I’m using C++ with opengl.

  • 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-26T07:26:41+00:00Added an answer on May 26, 2026 at 7:26 am

    I would like to reposition a circle, triangles, lines and an arc.

    So you already did draw the scene and now want to change the position of the objects?

    Well then, all you need to understand is, that OpenGL doesn’t maintain a scene graph of sorts. After submitting a draw call, things get only updates on the target framebuffer and that’s it. You want to change something? Clear the screen, redraw everything, but now with the adjustments applied.

    Really, OpenGL just draws things, it’s nothing more than sophisticated brushes (textures) and pencils (primitives) for some paper offered by the operating system (viewport/window).

    EDIT due to comment

    The usual interactive OpenGL graphics program with animations, programmed in a imperative programming language, is structured like this (pseudocode)

    float T = 0
    float alpha = 0, beta = 0
    float red = 0, green = 0, blue = 0
    
    paused = false
    
    on_mousemove(mousemove):
        alpha += mousemove.rel_x
        beta  += mousemove.rel_y
    
    on_keypress(keypress):
        switch keypress.key:
            case Key_ESCAPE:
                queue_event(Quit)
                return
    
            case Key_PAUSE:
                paused = not paused
    
            case Key_R:
                red += 0.1
            case Key_r:
                red -= 0.1
    
            case Key_G:
                green += 0.1
            case Key_g:
                green -= 0.1
    
            case Key_B:
                blue += 0.1
            case Key_b:
                blue -= 0.1
    
        queue_event(Redraw)
    
    render()
        glViewport(0, 0, window.width, window.height)
    
        glMatrixMode(GL_PROJECTION)
        glLoadIdentity()
        apply_projection()
    
        glMatrixMode(GL_MODELVIEW)
        glLoadIdentity()
        apply_modelview()
    
        glColor3f(red, green, blue)
        glRotatef(T * x_revolutions_per_second_factor, 1, 0, 0)
        glRotatef(alpha, 0, 1, 0)
        glRotate(beta, 0, 0, 1)
    
        draw_object()
    
        SwapBuffers()
    
    main:
        initialize_libraries()
        load_resources()
        create_window_and_OpenGL_context()
    
        previous_loop = get_time()
    
        loop 'eventloop':
            event = peek_event()
            switch event.type:
                case MouseMove:
                    on_mousemove(event.mousemove)
    
                case KeyPress:
                    on_keypress(event.keypress)
    
                case Quit:
                    break 'eventloop'
    
                case Redraw:
                    render()
                    break
    
                case NoEvents:
                    fallthrough
                default:
                    if not paused
                        render()
    
            current_loop = get_time()
            if not paused:
                T += current_loop - previous_loop
            previous_loop = current_loop
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a div that I would like to reposition each time the page
Would like to make anapplication in Java that will not automatically parse parameters used
Ok, I would like to use a CASE STATEMENT for this, but I am
I am using jQuery UI to display a dialog but I would like to
I have a side menu on my site that i would like always visible.
Would like to get a list of advantages and disadvantages of using Stored Procedures.
Would like to create a strong password in C++. Any suggestions? I assume it
Would like to be able to set colors of headings and such, different font
Would like to know what a programmer should know to become a good at
Would like to know the c# code to actually retrieve the IP type: Static

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.