Questions tagged [ray-picking]
54 questions
13
votes
2 answers
3D Ray Picking use Mouse Coordinates when Mouse isn't locked
So basically I've made a program using OpenGL which can perform 3D Ray Picking. If the Camera View Direction Ray touches/intersects anything (which isn't air) then a little purple box will get rendered at the intersection point/points.
If the ray…
vallentin
- 19,107
- 6
- 43
- 68
11
votes
1 answer
Camera Pitch/Yaw to Direction Vector
What I'm trying to do is cast a ray from my camera. I know the camera's x, y and z coordinates, as well as its pitch and yaw. I need to calculate its direction vector so I can pass it to my raytracing algorithm.
The camera's up vector is (0, 1, 0).…
RunasSudo
- 451
- 1
- 4
- 10
9
votes
1 answer
Object picking with ray casting
I've been having a problem with inaccuracies in my ray casting algorithm for detecting mouse hits within a box. I'm completely at a loss as to how to fix this properly and it's been bugging me for weeks.
The problem is easiest described with a…
sler
- 953
- 1
- 10
- 18
7
votes
4 answers
How to do Ray and Triangle Edge intersect?
I'm facing problem intersecting ray with triangle edges. Actually, I'm trying to pick/intersect with triangle, vertex, edge of a mesh using Mouse. So I made ray from the Mouse current position and then I intersect it with the mesh elements like…
Farhad Reza
- 296
- 3
- 14
4
votes
1 answer
Using glGetFloatv to retrieve the modelview matrix in pyglet
I'm doing 3d visualization in python using pyglet, and need to retrieve the modelview and projection matrices to do some picking. I define my window using:
from pyglet.gl import *
from pyglet.window import *
win = Window(fullscreen=True,…
user1223904
- 43
- 1
- 3
2
votes
0 answers
XNA Triangle picking on SkinnedModel
My game is using the SkinnedModel pipeline and AnimationPlayer to load and display models.
I've implemented ray picking with triangles by building a list of vertices and indices from the pipeline. This works, however the indices are static are only…
Neovivacity
- 109
- 2
- 14
2
votes
2 answers
OpenGL 3D-raypicking with high poly meshes
How to implement 3d raypicking in an 3d scene with models that contain high poly meshes?
It takes too much time to iterate over all triangles to perform a triangle-line-intersection test. I know that there exist methods like octree etc. and it…
Lemonbonbon
- 608
- 4
- 20
2
votes
1 answer
Is there a specified Ray object in DirectX
Im doing some work using ray-picking in a DirectX project and I just wondered whether there was an actual 'ray' object type? (rather than just storing direction/origin variables)
I know I could create something like
struct ray
{
D3DXVECTOR3…
unknownSPY
- 558
- 2
- 12
- 21
2
votes
1 answer
How to calculate UP and position of my camera?
I want to implement ray-picking in my game.
I follow this guide to implement it.
To calculate the actual ray I lack the lookAt and the up Vector.
The problem
I use glRotate and glTranslate instead of gluLookAt(eye,target,up) to rotate and move the…
boop
- 6,033
- 9
- 37
- 76
2
votes
0 answers
LWJGL Ray Picking (gluUnProject)
So I have been looking through tutorials (And questions on this site) and have found nothing to solve my problem. Here is the current code I am trying to implement:
private void pick() {
float[] matModelView = new float[16], matProjView = new…
zfollette
- 465
- 4
- 15
2
votes
1 answer
How to speed up band selection tool in a Dart WebGL application
The task at hand is to add a band selection tool to a Dart WebGL application.
The tool will be used to draw a rectangle over multiple objects by dragging the mouse.
Thus multiple objects can be selected/picked in a single user action.
I'm currently…
Everton
- 8,357
- 8
- 35
- 52
2
votes
1 answer
Ray picking with depth buffer: horribly inaccurate?
I'm trying to implement a ray picking algorithm, for painting and selecting blocks (thus I need a fair amount of accuracy). Initially I went with a ray casting implementation, but I didn't feel it was accurate enough (although the fault may have…
Fault
- 410
- 2
- 17
2
votes
2 answers
picking in 3D with ray-tracing using NinevehGL or OpenGL i-phone
I couldn't find the correct and understandable expression of picking in 3D with method of ray-tracing. Has anyone implemented this algorithm in any language? Share directly working code, because since pseudocodes can not be compiled, they are…
ibrahim demir
- 361
- 2
- 14
2
votes
1 answer
3D Graphics Picking - What is the best approach for this scenario
I am working on a project which allows users to pick 3d objects in a scene and I was wondering what everyone thought would be the best way to approach this particular scenario.
Basically we have a scene with at least 100 objects (they are low-poly…
poncho
- 881
- 2
- 11
- 33
2
votes
1 answer
How to reorientate the near and far planes from gluUnProject to account for camera position and angle?
I am trying to have a ray be traced from a mouse click on the screen into 3D space. From what I understand, the default position and orientation looks like this:
from this code:
GLint viewport[4];
GLdouble modelview[16];
GLdouble…
zzelman
- 415
- 5
- 14