A method typically used for determining what the user selected.
2
votes
1answer
127 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
0answers
113 views
Convert OpenGL code to DirectX
First of all, this is kind of a follow up question on @byte56 excellent anwser on this question concerning picking algorithms.
I'm trying to convert one of his code examples to directX 11 however I ...
0
votes
1answer
140 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
1answer
62 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
1answer
173 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 ...
4
votes
1answer
207 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 ...
-1
votes
1answer
175 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 ...
0
votes
0answers
75 views
Why would rotating the camera effect my pick ray?
So i'm trying to get terrain picking going.
I set up my ray, and I can pick out models, or sprites, whatever I want, no problem.
But when I try and get my 3D coords based off terrain collision it ...
-2
votes
1answer
215 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 ...
6
votes
2answers
193 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, ...
0
votes
0answers
113 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
2answers
236 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 ...
-3
votes
1answer
234 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. ...
1
vote
0answers
245 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. ...
1
vote
0answers
95 views
Numerically stable(ish) method of getting Y-intercept of mouse 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...
...
0
votes
1answer
260 views
Color Picking Troubles - LWJGL/OpenGL
I'm attempting to check which object the user is hovering over. While everything seems to be just how I'd think it should be, I'm not able to get the correct color due to the second time I draw ...
3
votes
1answer
255 views
Best way to Draw a cube for 3D Picking on a specific face
Currently I am drawing a cube for a game that I am making and the cube draw method is below. My question is, what is the best way to draw a cube and to be able to easily find the face that the cursor ...
4
votes
2answers
268 views
How do I use D3DXVec3Unproject with D3D11?
I'm having a small issue with D3DXVec3Unproject. I'm currently using Direct3D 11 and not 10, and the signature for this function is:
D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV, CONST D3D10_VIEWPORT ...
4
votes
2answers
499 views
Get world coordinate under mouse (at a ground plane for Warcraft 3 like movement)
I want to let a unit follow the mouse like in any RTS (Warcraft 3, Starcraft, ...). For that I have a "ground plane" which is defined through 2 vectors, the X and Z axis. Now I need to get the world ...
2
votes
1answer
300 views
OpenGL 3+ Range Picking
How do I perform range picking in the latest OpenGL version? By range picking I mean selecting all objects which are picked using a selection rectangle, like in an RTS game.
For single object picking ...
0
votes
1answer
204 views
Java Slick2d - Mouse picking how to take into account camera
When I move it it obviously changes the viewport so my mouse picking is off.
My camera is just a float x and y and I use g.translate(-cam.cameraX+400, -cam.cameraY+300); to translate the graphics. I ...
1
vote
1answer
204 views
How to perform efficient 2D picking in HTML5?
I'm currently using an R-Tree for both picking and collision testing. Each entity on screen has a bounding box for collisions and a separate one for picking. Since entities may change position very ...
4
votes
2answers
912 views
Ray Picking Problems
I've read so many answers on here about how to do Ray Picking, that I thought I had the idea of it down. But when I try to implement it in my game, I get garbage.
I'm working with LWJGL.
Here's the ...
3
votes
1answer
301 views
3d Picking under reticle
i'm currently trying to work out some 3d picking code that I started years ago, but then lost interested the assignment was completed (this part wasn't actually part of the assignment).
I am not ...
-1
votes
2answers
524 views
How do I pick correct tile in isometric 3D map?
I want to know how to pick the correct tile on a isometric map in 3D space. Here is a 2D example.
They use a colour key map to correctly pick the coordinate. How can I achieve this in 3D space? Is ...
6
votes
1answer
146 views
Excluding Background from Color Picking
I've implemented picking based on color coding, but I don't want the background color to be pickable. Is there any way in openGL (2.x) to exclude the background color? For some reason, doing ...
2
votes
1answer
82 views
Triangle Picking Picking Back faces
I'm having a bit of trouble with 3D picking, at first I thought my ray was inaccurate but it turns out that the picking is happening on faces facing the camera and faces facing away from the camera ...
1
vote
0answers
462 views
Picking 3D object with Mouse when using Camera Zooming in XNA 4.0
I've tried to figure out how to do picking with the mouse, and things work great when zoomed in all the way with the camera (Third Person Camera). And it works perfectly when using First Person ...
3
votes
2answers
608 views
Picking 2D objects after transforming camera in XNA
I have an XNA application (a force based visualisation of some circles) that I've implemented zooming and scrolling in, thanks to this guide.
Before I had the camera implemented, I had picking ...
-2
votes
2answers
379 views
Picking a tile in an Iso Engine
I have developed an iso engine for a farm game. In general it works fine, but the problem is that it is not always accurate when pressing the tiles, so the tile I wanted to select is not the one ...
0
votes
0answers
223 views
Why does RayIntersect return wrong values?
I'm trying to implement Object picking. My BasicModel.cs has a function:
public bool CheckRayIntersection(Ray ray)
{
//Where aabb is the BasicModel's BoundingBox
if ...
2
votes
0answers
966 views
Controlling 3D model with mouse XNA 4.0 C#
I am creating a 3D table tennis game and the racquet (created in Maya 2012) is controlled by the mouse. I have used picking method to control the racquet, however the cursor is not on the racquet. It ...
1
vote
1answer
164 views
Why is texturing interfering with my ID-based picking implementation?
Today I came across a tutorial about color picking and I implemented it on my machine. But there is a problem: when I disable the texture and draw the object I want to pick with its picking color, it ...
0
votes
3answers
3k views
3D picking lwjgl
I have written some code to preform 3D picking that for some reason dosn't work entirely correct! (Im using LWJGL just so you know.)
I posted this at stackoverflow at first but after researching some ...
3
votes
1answer
1k views
Opengl-es picking object
I saw a lot of picking code opengl-es, but nothing worked. Can someone give me what am I missing?
My code is (from tutorials/forums)
Vec3 far = Camera.getPosition();
Vec3 near = ...
1
vote
1answer
2k views
Picking objects with mouse ray
I simply want to pick a few spheres in my scene using the mouse-ray. I have implemented(copied most of it but with little understanding) a ray-sphere collision code. Also I have implemented the code ...
3
votes
1answer
661 views
Ray picking - get direction from pitch and yaw
I am attempting to cast a ray from the center of the screen and check for collisions with objects.
When rendering, I use these calls to set up the camera:
GL11.glRotated(mPitch, 1, 0, 0);
...
2
votes
1answer
530 views
Triangle accuracy picking for animated models in XNA
I can do picking with triangle-accuracy for non-animated models, but I also have animated models in my game. How do I do picking on animated models?
I use code based on this project for animation.
...
4
votes
2answers
4k views
How do you determine which object/surface the user's pointing at with lwjgl?
Title pretty much says it all. I'm working on a simple 'lets get used to lwjgl' project involving manipulation of a rubik's cube, and I can't figure out how to tell which side/square the user's ...