Questions tagged [ray-picking]
56 questions
1
vote
1 answer
How to select objects when using the Orthographic camera in Three Js
I've got an isometric level going and I'm trying to select objects within the level.
I've looked at a few Stackoverflow answers including this one Orthographic camera and selecting objects with raycast but at the moment, nothing seems to be…

Rohan Deshpande
- 694
- 8
- 22
1
vote
0 answers
How to convert mouse coordinates into world coordinates
What I want to do
Picking an object.
Requirements / Conditions
My mouse is always in the center of the screen.
Pick only the first / nearest object
What I want to know
How can I convert my mouse coordinates (actually 0,0 since the mouse is…

boop
- 7,413
- 13
- 50
- 94
1
vote
1 answer
Where did I go wrong trying to implement picking with raycasting in OpenGL ES 2.0 for iOS?
I'm trying to implement picking with raycasting in OpenGL ES 2.0 for an iPad App. Specifically, I want to know which cell of a minecraft-like map made up of square cells with varying heights the user has tapped on. However, my code does not find an…

Ben Pious
- 4,765
- 2
- 22
- 34
1
vote
1 answer
How to efficiently implement "point-on-heightmap" picking in OpenGL?
I want to track the mouse coordinates in my OpenGL scene on the ground surface of the world which is modeled as a height map. Currently there is no fancy stuff like hardware tessellation. Note that this question is not about object…

leemes
- 44,967
- 21
- 135
- 183
1
vote
2 answers
OpenGL ES 2.0 Ray Picking, far point
Help me please with ray picking
float aspect = fabsf(self.view.bounds.size.width / self.view.bounds.size.height);
GLKMatrix4 projectionMatrix = GLKMatrix4MakePerspective(GLKMathDegreesToRadians(35.0f), aspect, 0.1f, 1000.0f);
GLKMatrix4…

Volodymyr B.
- 3,369
- 2
- 30
- 48
0
votes
1 answer
OpenGL: mouse move objects, object can't follow mouse
After picking an object with the mouse, I want to be able to move the object using the mouse. First, I translate mouse position to world position, and use glReadPixels() to read the depth of the object as z's:
double xpos, ypos,…

yan
- 1
0
votes
0 answers
Ray picking origin in front of the camera
I am trying to implement a ray picking algorithm. I want to get a ray that allow me to then check, which vertex is under my cursor. I've followed a few tutorial but i get a strange result. My origin is located in the center of the screen, the…

Tackwin
- 69
- 1
- 4
0
votes
1 answer
Question about 3D Picking in Android (with OpenGL ES 2)
I need some help on 3D picking.
I am using the way it works here. In short, what I have is:
normalizedPoint[0] = (x * 2 / screenW) -1;
normalizedPoint[1] = 1 - (y * 2 / screenH);
normalizedPoint[2] = ?
normalizedPoint[3] = ?
for 2 and 3, I have no…

xandy
- 27,357
- 8
- 59
- 64
0
votes
1 answer
GPU Picking inconsistent across devices
I’m trying to implement GPU picking with Points using code I modified from the latter half of this article https://threejsfundamentals.org/threejs/lessons/threejs-picking.html
It’s been working fine for me on desktop, but I started testing different…

Deklan Webster
- 25
- 4
0
votes
1 answer
opengl ray picking/tracing with cardboard (GVR)
For the demonstration, I made a small application that draws three squares of random size and random location.
Drawing squares:
private void renderObject(float[] modelViewProjection, FloatBuffer vertexCoordsBuf, int i) {
…

Anton111111
- 656
- 1
- 7
- 23
0
votes
1 answer
Ray picking in android - how to manage different shapes
I`m confused. I've read a lot of different tutorials related with ray picking. But every time those example are based on some simple shape, square or triangle. In each example for each shape there is a function that is checking this specific shape.…

Fixus
- 4,631
- 10
- 38
- 67
0
votes
1 answer
How do I get the ray direction of where I click on the screen in world coordinates (DX11, C++)
I'm trying to convert the point of which I click on the screen to get a ray direction of where I'm clicking. Eventually this will be used for an intersection of some sort. The direction I have now seems to produce strange results and I'm not sure…

user
- 21
- 3
0
votes
1 answer
Hit tests in SharpDX do not work after rotating a model
In the example I want to use to demonstrate my problem, I have a single model of a turbine and a small grid as shown in the images below. The bounding box of the model is displayed as a red box. I try to check which nodes in my green grid lie above…

GameDevAlien
- 195
- 1
- 17
0
votes
1 answer
get 3d objects name by touching using min3d android
i need to add features of my android project, to get each name of the 3d objects. The objects are irregular and it can be rotate based on the user's gesture. I have lots of reading on openGL ray picking but still cant figure out how to make it work.…

sarabrown
- 11
- 2
0
votes
0 answers
Intersection test for ray picking in opengl es for android
Ok so I was able to get the coordinates in 3d space for the touch now I need to test whether that ray intersected a triangle. What I am asking is for help to understand the Test Class. BTW this code came from…

Dakota Miller
- 493
- 1
- 4
- 22