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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T09:10:43+00:00 2026-06-01T09:10:43+00:00

I’m don’t understand how we can positioning objects with opengl. All transformation values is

  • 0

I’m don’t understand how we can positioning objects with opengl. All transformation values is between “-1.0f” – “1.0f”. I’m made some game using with surfaceview. And I can simply change and defined objects x and y position. example; if android screen width is 480px, so my box max x values is 480. but how can I do this on opengl? How make the limits and how use pixel or dpi metrics? how can I change a box position on my finger touch place?

  • 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-06-01T09:10:44+00:00Added an answer on June 1, 2026 at 9:10 am

    First off, glTranslate and most if not all transformation values are not restricted to values between “-1.0” to “1.0”. Being able to move an object 10px to the left or right is going to require setting up your transformation matrices properly. Below is the order of how OpenGL manipulates vertexes you give it.

    [(4×4) Projection][(4×4) View][(4×4) Model]*[(4×1) your vertex]

    You would probably want to use glOrtho(0.0,width,0.0,height,-1.0,1.0) to setup your Projection matrix. You can leave the View matrix as the identity matrix. Finally, you can use your model matrix to translate, rotate, and scale your objects at a pixel scale. Now a glTranslatef(10.0,0.0,0.0) on the Model matrix should move your object 10px in the x direction. Alternatively, you could leave the Model matrix as the identity matrix, and let your vertexes represent pixel coordinates.

    You can look at this powerpoint, and on slide 4 you can see a nice graphic detailing whats happening to your vertexes. https://wiki.engr.illinois.edu/download/attachments/195761441/OpenGL.pptx?version=1&modificationDate=1326820017000

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
I have a jquery bug and I've been looking for hours now, I can't
I am reading a book about Javascript and jQuery and using one of the
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this

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.