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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T03:33:49+00:00 2026-05-22T03:33:49+00:00

Is this possible to do with OpenGL-ES? Im trying to make a quite simple

  • 0

Is this possible to do with OpenGL-ES?

Im trying to make a quite simple 3D game in android with the use of OpenGL-ES.
Now im stuck on the part where i think that using a ray to get the coordinates of a point on the surface of a sphere depending on 2D touch coordinates, would be the best way.

Im fairly new to 3D programming and openGL overall but all the tutorials iv’e found on the internet on how to achive this is by using methods OpenGL-ES don’t support.

I guess using the inverse of my perspective projection transform is how it’s supposed to be, but i hav’e now clue how to get that.

(Im setting up my perspective to 45 degrees with GLU.gluPerspective)

  • 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-22T03:33:50+00:00Added an answer on May 22, 2026 at 3:33 am

    I have recently come across this as well as part of my bachelor-thesis. I haven’t found a direct way to do this with opengl.
    What I have done is I have taken the x and y coordinates of the touch point. I then created two 3D points, one with the z-value 1 and one with z=-1. This gives you two different coordinates. And then you just take the inverse of your transformation matrix just as you guessed. If you manage the matrix yourself that shouldn’t be too hard. If you let OpenGL manage the matrix you should be able to get the inversed matrix by calling gluUnproject (http://www.opengl.org/sdk/docs/man/xhtml/gluUnProject.xml).
    This will give you two points in object coordinates, now you have your ray, and now you can intersect this ray with all the objects you want to. (Here is an extensive list of intersection algorithms between different objects with code examples: http://www.realtimerendering.com/intersections.html)

    Just in case you’re interested: As part of my bachelor thesis I am creating a 3D Rendering Engine that should take a lot of this work away from the developer. It’s still work in progress, but if you’re interested, you can take a look: https://github.com/Chnoch/Bachelor-Thesis
    PM me if you’d like more information

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

Sidebar

Related Questions

I'm working on a c++ code that uses SDL/opengl. Is this possible to create
Is this possible? Situation is that I want to store some XML in my
if this possible to write a com control or activex in C# and use
Anyone know how to create an OpenGL ES app that doesn't use the full
i am trying to load md2 files in opengl but i noticed that most
Is this even possible? Im learning DirectX atm and am trying to apply some
I have some simple OpenGL ES code in C++ that I've run on a
Good afternoon. I have been making a small openGL based app for android that
My question is about game loop design in opengl. I believe that game loop
I'm trying to make a vector drawing application using OpenGL which will allow the

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.