2022 Developer Survey is open! Take survey.

Questions tagged [picking]

A method typically used for determining what the user selected.

Filter by
Sorted by
Tagged with
0 votes
0 answers
21 views

How to select one game object and move it?

For example, I have two game objects, cube1 and cube2, in a scene. I want to be able to click on one and move it. I know how to use ray to highlight it, like below: ...
user avatar
0 votes
1 answer
100 views

How to select a sprite with the mouse in c# XNA?

I'm attempting to create a chess game, for the movement I need to be able to click on a piece with the mouse, and then the square I'd like to move it to. Each piece on the board is a sprite, and I'm ...
user avatar
  • 1
1 vote
0 answers
184 views

glReadPixels performance not improving with PBO

I'm currently using glReadPixels to read from the depth buffer to calculate where on the map the player is pointing, for the purpose of placing objects on the ground. I do this after rendering the ...
user avatar
  • 762
0 votes
1 answer
181 views

How to select top most gameObject in a stack of gameObjects?

I'm stuck trying to figure out how I can select the top most GameObject in a stack of GameObjects. In the picture below, I have a Green and Yellow circle stacked on top of each other. If I try to ...
user avatar
0 votes
1 answer
218 views

why does Physics.Raycast always return my player game object instead of the object I clicked?

I have 3D world. I want to detect when the player clicks on a game object in the world. In this image, I have 2 objects I want to detect mouse click on. The white sphere does have collider on it. The ...
user avatar
0 votes
2 answers
135 views

Pixel-perfect 3D sprite-picking on cylidrical-billboarded sprites?

Background Info I have an OpenGL app where a player (just an AABB with an eye-height, look and move vectors), can walk along a 3D grid made of a square cells, essentially like a player walking along ...
user avatar
  • 49
0 votes
1 answer
198 views

Can't figure out why my mouse picking code doesn't work

I am trying to create code to check for intersections between bounding spheres and the mouse. I get a mouse ray but it doesnt seem to point in the direction you think it should Attached is a ...
user avatar
1 vote
1 answer
103 views

Why are points adjusted using the projection and inverse view matrix during picking?

I am working on my first 3D game, which contains several vehicles placed on a board. I want to implement mouse picking of the vehicles. I found this great tutorial and used its code. But I don't ...
user avatar
1 vote
0 answers
57 views

Why are coordinates converted to [-1, 1] during mouse picking?

I am working on my first 3D game, which contains several vehicles placed on a board. I want to implement mouse picking of the vehicles. I found this great tutorial and used its code. But I don't ...
user avatar
1 vote
1 answer
66 views

How to select two different instances in Unity C#

I have 2 Balls, 2 Nodes, and 1 Hand. I can pick up a ball, send it to a Node, grab it, put it on another Node, but I can't grab any other balls. The problem is that the Ball is defined publicly in ...
user avatar
  • 13
1 vote
1 answer
937 views

Simple mouseray picking in openGL

Ive been looking at tutorials and trying to figure out how to do basic ray-picking. But I'm stuck at figuring out what space to do the distance calculations in. What space does ...
user avatar
  • 332
2 votes
1 answer
97 views

How can I ungrab the grabbed Object in Unity?

I modified a grab Script to my purpose, I can grab the Object and make it a parent to the character with the Key "G" but I want to let it go and detach the parent of the picked Object with "H" with ...
user avatar
  • 141
3 votes
1 answer
1k views

Isometric tiles drawing and picking - JAVA

I'm trying to draw isometric tiles in Java and implement a tile picking system using the mouse cursor. I draw the tiles using math formulas I found and adapted to my tile textures which you can find ...
user avatar
3 votes
0 answers
336 views

How can I compute a 3D picking ray from 2D screen coordinates?

I have a view matrix via glm. I want to make a ray casting system that receive an X and Y coordinate from the screen and generates a ray in the world. What math is needed? My view matrix is built ...
user avatar
1 vote
0 answers
602 views

OpenGL to DIRECTX RayCasting and Picking

Im doing some ray casting and picking from a book that is Open GL. I Get perfect movement on the x and y(I rotated the grid 90 so it would match the x and y. Buy when I try to put it on the the z axis,...
user avatar
  • 21
0 votes
1 answer
120 views

FBO picking in Oculus Rift applications

I am writing an Oculus Rift application, I am rendering a very high poly mesh that I wish to be able to perform picking on using the Oculus Touch. Ideally, I want to be able to get the "triangle" id ...
user avatar
0 votes
1 answer
551 views

How do I implement object picking, using OBB in OpenGL?

I am trying to make 3D drawing software. I wanted to have the drag feature so I am using object picking using the OBB algorithm. I am facing problems in understanding the algorithm, and my ...
user avatar
  • 1
1 vote
1 answer
174 views

Isometric tile picking algorithm not working

Starting to gamedev again and Trying an isometric game. However, all I try, I can't seem to figure out tile picking properly.. Using SFML Here's how I'm detecting the clicks and moving around a sf::...
user avatar
8 votes
1 answer
2k views

Pixel Picking vs Raycasting

I was recently introduced to a way of picking in OpenGL known as pixel picking (or color picking). From my understanding, how this is done is that the scene is rendered to the back buffer with a ...
user avatar
  • 1,401
4 votes
2 answers
508 views

Tilemap Object Placement

I am looking for a way to select tiles within a bounding box for object placement within a scene/world, similar to Roller Coaster Tycoon and other simulation games. (source: tumblr.com) In the ...
user avatar
  • 1,369
4 votes
3 answers
266 views

Restricting movement to 3D axis

A cube is constructed in a 3D and can be rotated to view any side. I want to be able to drag the cube to any position with the mouse while keeping the Y-coordinate the same. I used project and ...
user avatar
1 vote
1 answer
295 views

picking 3D objects rendered using instancing

i have a peice of code that renders a 3D image, say a cube. I require 3 cubes in in different locations, this is done using instancing and i am able to render the cube in 3 different locations. ...
user avatar
1 vote
1 answer
718 views

Heightmap terrain picking

I've implemented an OpenGL based terrain unsing a tesselation-shader for dividing each 'terrain-cell' into the desired tiles. The heightmap is uploaded to the GPU and applied on the shader. When it ...
user avatar
1 vote
1 answer
323 views

OpenGL Picking: How to avoid entities?

I have a terrain and entities(npc, house...). I'm able to convert screen coordinates to world coordinates with the glReadPixels function: ...
user avatar
  • 309
7 votes
3 answers
1k views

How should I store dynamic game entities for efficient area-based selection?

In my 2d block-based game I'm trying to implement a data structure that would store entities entities in a way that's capable of: Direct selection based on coordinate. Iteration Iteration limited to ...
user avatar
5 votes
1 answer
2k views

OpenGL picking performance: ray casting vs. color picking

I am curious of how the performance of color picking compares to ray casting. I am looking at the scenario when the mouse is clicked which means only then the scene is rendered in a backbuffer for ...
user avatar
0 votes
0 answers
54 views

3D Picking: Doesn't Work Consistently

I'm trying to implement a 3D picking function that at the moment simply calculates the ray being sent from the camera after the user clicks the mouse on the window. It kind of works well when the ...
user avatar
4 votes
3 answers
1k views

How do I pick tiles from an isometric map with slopes?

I'm looking for a way to convert mouse/screen coordinates to isometric map coordinates, with the addition that the world has slopes and cliffs, and I have to be able to tell which quadrant of the tile ...
user avatar
  • 141
0 votes
1 answer
294 views

issue with ray/physics collision detection

All, I am trying to pick object using ray collision and bullet physics I am initializing my projection and view matrix only once, here is the code ...
user avatar
0 votes
1 answer
429 views

Get fragment from mouse position

I have a painting app for texture artists that I am working on. I am able to paint to a flat canvas that updates the texture of a 3d object in an object viewer. Now I want to be able to paint directly ...
user avatar
1 vote
3 answers
1k views

3D picking for mouse move event

I implemented color picking recently and I would like to use it as kind of highlight when mouse is over an object but I am concerned about performance. Color picking requires whole frame to be drawn, ...
user avatar
  • 4,870
4 votes
2 answers
8k views

How do I get mouse x / y of the world plane in Unity?

I am trying to make a tiled landscape. The terrain itself is not made from tiles but the world has a grid which I define. I would like to place boxes/rectangles which snap to this grid, at runtime, ...
user avatar
  • 168
1 vote
2 answers
3k views

OpenGL 2.0 - How to swap buffers for color picking

I'm trying to reproduce color picking on iOS, following the technique described here: http://www.lighthouse3d.com/opengl/picking/index.php3?openglway2, with OpenGL ES 2.0. When the user touches the ...
user avatar
  • 337
0 votes
0 answers
255 views

how to do picking in 2d lwjgl

I searched the whole internet, but I couldn't find something useful. How to do picking (like ray picking) in lwjgl in orthographic mode (2d)? I think this is less confusing than picking in 3d, but I ...
user avatar
3 votes
1 answer
399 views

How can I GL_SELECT from a gluPerspective-transformed scene?

I'm using JOGL to access OpenGL-methods on an old OpenGL version, because of school. I have written a method which is called before any objects are drawn. This method shows which object is picked. ...
user avatar
  • 33
1 vote
1 answer
676 views

Understanding implementation of glu.PickMatrix() [closed]

I am working on an OpenGL project which requires object selection feature. I use OpenTK framework to do this; however OpenTK doesn't support glu.PickMatrix() method to define the picking region. I ...
user avatar
1 vote
1 answer
118 views

Picking problem with rotated view matrix

I have picking code that works, if my view matrix has no rotation (only translation). Now If I rotate my camera, picking goes to hell. I cant find whats wrong My code: ...
user avatar
  • 1,076
2 votes
1 answer
2k views

How to tell what part of a 3D cube was touched

I am writing a rather simple android game and I am implementing Open GL to draw a 3D cube that spins upon the X, Y and Z axis and I need to know where the user has clicked on the texture of the cube. ...
user avatar
  • 21
0 votes
1 answer
1k views

How can I remove the view and projection matrix from ray position to get only the ray model?

I've got a little problem with my picking module and I need your help. I have a method to project a ray from the camera to a fixed point when I click somewhere. The computed ray looks good, it go to ...
user avatar
  • 313
2 votes
1 answer
353 views

Manual GLU.gluUnproject

Before I used GLU.gluUnproject to calculate my picking ray in my OpenGL game. Recently I switched to my own calculated matrices, and now I can forget the gluUnproject. How can I calculate the picking ...
user avatar
  • 1,043
2 votes
1 answer
2k views

libgdx collision/picking

I am trying to make something with java libgdx (2D). One thing that I can't figure it out is how to check mouse intersection with (fore example) isometric textures that are not rectangle shaped images....
user avatar
  • 233
4 votes
1 answer
2k views

Picking 3D with OpenGL ES 2

I'm trying to implement picking in my framework but I don't understand how I can do this. I'm working with: OpenGL ES 2. GLM mathematic library. What I have understand, picking can be made with two ...
user avatar
  • 313
-1 votes
1 answer
727 views

Changing map 0,0 origin to top left while using D3DXMatrixOrthoLH

Thanks to Tetrad (for pointing out D3DXMatrixOrthoLH ) I have figured out how to set it up in DirectX9. However, the problem I am now facing is my 0,0 mouse position is now in the middle. What I ...
user avatar
  • 143
-2 votes
1 answer
270 views

Game Editor - When screen is clicked, how do you identify what coordinate you clicked?

This is a follow-up to my earlier question: Game Editor - When screen is clicked, how do you identify which object that is clicked? Something I've noticed is that picking only calculates a ray and ...
user avatar
  • 773
8 votes
2 answers
2k views

How do I convert a 2D movement (from mouse) to a displacement along a 3d axis?

I'm making a small 3D scene editor (that only allow to modify objects positions). Each object is draw with a 3d X/Y/Z axis : How it works : user choose an axis (X, Y or Z) by left clicking on it, ...
user avatar
  • 3,132
2 votes
0 answers
425 views

How to create 3d picking ray with the cursor position

I'm new here and I'm not sure how to go about doing this. I am creating an application that is supposed to use the cursor's position in the window to perform 3d picking. The tutorials I have found ...
user avatar
  • 102
2 votes
2 answers
322 views

Assigning a different texture based on picking

I'm making a game using XNA. I have some simple objects like cube and sphere, and I would like to change the texture of one face of these objects based on picking. That is, when the cursor is over ...
user avatar
-4 votes
1 answer
542 views

Isometric Rendering and Picking [duplicate]

Possible Duplicate: Isometric rendering and picking? I've been looking for a formula to plot (world->screen) and mouse pick (world->screen) isometric tiles in a non-diamond-shaped world. What's ...
user avatar
1 vote
0 answers
810 views

2D isometric picking

I'm trying to implement picking in my isometric 2D game, however, I am failing. First of all, I've searched for a solution and came to several, different equations and even a solution using matrices. ...
user avatar
  • 111
2 votes
2 answers
750 views

Unproject mouse position to tile -- extremely jumpy position?

I'm trying to unproject the mouse position to get the position on the X-Z plane of a ray cast from the mouse. The camera is fully controllable by the user. Right now, the algorithm I'm using is... <...
user avatar