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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T04:56:42+00:00 2026-06-07T04:56:42+00:00

I am making an Android game app and am using openGL to load 3D

  • 0

I am making an Android game app and am using openGL to load 3D obj models into the app. I would like to know if anyone can help me on how to make these objects interactive. All I really need is to make an object clickable, but it would be cool to learn more such as dragging it around the screen and such.

Thanks for any help.

  • 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-07T04:56:44+00:00Added an answer on June 7, 2026 at 4:56 am

    What you want is called picking.

    This isn’t a easy task an depending on want you want to do exaclty you have mutliple options to do it.

    The Problem: You want to select an Object in 3D space based on a 2D coordinate (mouse/touch position). Because of the 2D mouse coordinates you miss one coordinate to determine the exact click position in the 3D space.

    One possible option would be:

    • Render your object with a specific color (e.g. completely red)
    • After that save the current display buffer to a variable
    • Clear the display buffer and render your model again with the standard settings (this is the screen that is displayed to the user)
    • determine the click/touch position translate it to a coordinate on your display area
    • check the color at this coordinate in your saved display buffer. If the color at this position is red, the user clicked/touch an object

    This approach isn’t that flexible but the implementation is very simple compared to other solutions. It is limited because you can only detect if the used clicked/touched a certain object or not but you cannot determine the exact position on the object.

    Another possible option is to compute a ray on the 3D world based on the 2D click position and then determine all objects in 3D space that collide with this ray. This is called ray picking.
    You can find a OpenGl tutorial for ray picking here

    The example uses glRenderMode, glLoadName, etc. which maybe isn’t the best choice if you are not using the fixed function pipeline (e.g. you are using custom shaders, etc.).

    Another option whould be to do the math and compute the ray vector yourself based on click position, viewport and projection matrices. If you want to do this the documentation of gluUnproject can help you.

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

Sidebar

Related Questions

I am making an android app for http://yearbook08.com/ I know how to parse through
For a 2D game I'm making (for Android) I'm using a component-based system where
I am making a game for Android and using Rails for server coding, and
I'm currently developing my first game app for android OS using Processing. I need
We are in the making of an Android app, a quiz game, which we
i am making a game using andengine in android, in this game various sprites(eggs)
I am making an android 2d game and ran into a problem. I made
So in an android game (using andEngine) I'm making, I'm trying to save a
I'm making a game for Android and I'm using transparent PNG's. But does the
I am new to android development, making a simple game and using onKeyDown(.....) function

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.