Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [picking]

A method typically used for determining what the user selected.

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

How do I pick terrain in GLSL/OpenGL by picking 2D vertices positions?

Presumably the problem is with the internal formats and my understanding of that, but I've been stuck a while, got this sort of approaching working fine on a more straight forward colour picker, but ...
Paul's user avatar
  • 1
0 votes
0 answers
56 views

OnPointer events trigger when entering transform, not on custom collider

I want to create a custom UI, specifically an action wheel which offers different actions depending on where or what was clicked. To do that, I create circle segments (slices). I also create a custom <...
ElDuderino's user avatar
0 votes
0 answers
140 views

How can I change the texture of a prefab clone when it's clicked?

I have a prefab (called ArableLand), and when I click on the ground in the play mode, the ArableLand prefab instantiates a clone of itself. For example, if I click 3 times on 3 different places, then ...
Makaron's user avatar
  • 35
0 votes
1 answer
203 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 ...
jriley's user avatar
  • 1
1 vote
0 answers
516 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 ...
Nairou's user avatar
  • 594
-1 votes
1 answer
483 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 ...
Michael Hampshire's user avatar
0 votes
1 answer
321 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 ...
tatmanblue's user avatar
0 votes
2 answers
198 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 ...
ps48's user avatar
  • 69
0 votes
1 answer
341 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 ...
Hayden Morris's user avatar
1 vote
1 answer
230 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 ...
Jan Pazdera's user avatar
1 vote
0 answers
63 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 ...
Jan Pazdera's user avatar
1 vote
1 answer
87 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 ...
Haven's user avatar
  • 13
1 vote
1 answer
1k 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 ...
Charlie's user avatar
  • 342
2 votes
1 answer
125 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 ...
Daniel's 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 ...
RomainImberti's user avatar
3 votes
0 answers
481 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 ...
Laceanu George's user avatar
1 vote
0 answers
683 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,...
Terry's user avatar
  • 21
0 votes
1 answer
122 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 ...
Mostafa Abdelraouf's user avatar
0 votes
1 answer
679 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 ...
dkoder's user avatar
  • 1
1 vote
1 answer
183 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::...
Rando Hinn's user avatar
8 votes
1 answer
3k 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 ...
DarkDestry's user avatar
  • 1,441
4 votes
2 answers
592 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 ...
Zack Brown's user avatar
  • 1,459
4 votes
3 answers
276 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 ...
introVertice's user avatar
1 vote
1 answer
338 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. ...
introVertice's user avatar
1 vote
1 answer
794 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
372 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: ...
Aldo's user avatar
  • 319
7 votes
3 answers
2k 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 ...
DifferentPseudonym's user avatar
5 votes
1 answer
3k 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 ...
Sjoerd222888's user avatar
0 votes
0 answers
59 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 ...
Xenoprimate's user avatar
4 votes
3 answers
2k 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 ...
LordAro's user avatar
  • 141
0 votes
1 answer
306 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 ...
mgs_bravo's user avatar
0 votes
1 answer
525 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 ...
Deniz Cetinalp's 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, ...
wondra's user avatar
  • 4,930
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, ...
Discipol's 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 ...
DAN's user avatar
  • 337
0 votes
0 answers
271 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 ...
user2190492's user avatar
3 votes
1 answer
422 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. ...
Fruro's user avatar
  • 33
1 vote
1 answer
738 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 ...
stoney78us's user avatar
1 vote
1 answer
122 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: ...
Martin Perry's user avatar
  • 1,106
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. ...
Clayton's 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 ...
user30088's user avatar
  • 353
2 votes
1 answer
386 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 ...
Basaa's user avatar
  • 1,053
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....
Tom's 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 ...
user30088's user avatar
  • 353
-1 votes
1 answer
762 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's user avatar
  • 143
-2 votes
1 answer
276 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 ...
Deukalion's user avatar
  • 793
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, ...
tigrou's user avatar
  • 3,214
2 votes
0 answers
518 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 ...
Kwauhn's user avatar
  • 102
2 votes
2 answers
324 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 ...
Thomas Carmichael's user avatar
-4 votes
1 answer
568 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 ...
Petris Rodrigo Fernandes's user avatar