Questions tagged [picking]
A method typically used for determining what the user selected.
74
questions
0
votes
0
answers
26
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 <...
0
votes
0
answers
124
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 ...
0
votes
1
answer
180
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 ...
1
vote
0
answers
407
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 ...
-1
votes
1
answer
427
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 ...
0
votes
1
answer
304
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 ...
0
votes
2
answers
187
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 ...
0
votes
1
answer
323
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 ...
1
vote
1
answer
210
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 ...
1
vote
0
answers
61
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 ...
1
vote
1
answer
84
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 ...
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 ...
2
votes
1
answer
121
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 ...
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 ...
3
votes
0
answers
443
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 ...
1
vote
0
answers
659
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,...
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 ...
0
votes
1
answer
650
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 ...
1
vote
1
answer
181
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::...
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 ...
4
votes
2
answers
576
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 ...
4
votes
3
answers
274
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 ...
1
vote
1
answer
332
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. ...
1
vote
1
answer
787
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 ...
1
vote
1
answer
362
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:
...
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 ...
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 ...
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 ...
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 ...
0
votes
1
answer
304
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
...
0
votes
1
answer
505
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 ...
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, ...
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, ...
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 ...
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 ...
3
votes
1
answer
416
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.
...
1
vote
1
answer
722
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 ...
1
vote
1
answer
121
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:
...
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.
...
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 ...
2
votes
1
answer
379
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 ...
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....
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 ...
-1
votes
1
answer
755
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 ...
-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 ...
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, ...
2
votes
0
answers
495
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 ...
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 ...
-4
votes
1
answer
562
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 ...
1
vote
0
answers
821
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. ...