Questions tagged [mouse-picking]

77 questions
2
votes
1 answer

java3d Picking objects

I am building a java3d GUI, using which users can create custom scene graphs, without needing to know the code, i want to pick specific boxes using mouse, and i want to be able to move them around.. so for that i need picking.. There are say, 2…
2am
  • 699
  • 1
  • 7
  • 25
1
vote
1 answer

Correct way to generate 3d world ray from 2d mouse coordinates?

Mostly all answers I've found involve multiplying a vector of normalised device coordinates by a inverse(projection * view) matrix, however every example I've tried results in at least two invalid things.. No variation of the worldray.xy at varying…
1
vote
1 answer

Getting incorrect vectors when trying to do mouse picking in OpenGL 3

I am trying to get a direction vector to where my cursor is on the screen, however it gives me large values instead of the actual values. When doing mouse picking I am getting extremely small numbers for my world coordinates such as Mouse is…
rial
  • 705
  • 7
  • 17
1
vote
1 answer

glReadPixels() is not accurate

I want to do mouse picking based on colors. Here is my code: bool Geometry::IsObjectClicked(int x, int y, float color[4]) { glFlush(); glFinish(); glPixelStorei(GL_UNPACK_ALIGNMENT, 1); struct { GLubyte red, green, blue; } pixel; …
Uytab
  • 85
  • 1
  • 7
1
vote
1 answer

PCL:How to picking other PointCloud in the PCL Visualization

I want picking other PointCloud but the "cloud" in the PCL Visualization. However the registerAreaPickingCallback() doesn't support pass PointCloud arg. By default,only the default pointcloud:"cloud" is avalible and the indices of the callback…
Roser
  • 13
  • 4
1
vote
1 answer

In modern OpenGL, how do I avoid overwriting data in FBO colour attachments with invalid fragments?

I have a batched rendering pipeline that uploads a bunch of quads to OpenGL. These are rendered to an FBO. Naturally, one of the attachments is visual output and another is depth, allowing for post-processing etc. However, a third attachment is…
Stefan Bauer
  • 393
  • 1
  • 9
1
vote
1 answer

intersection between world space view vector and point in world

after calculating the world space view vector from screen coordinates (using Click to zoom in WebGL), given an array of vertices, how do I find the closest intersecting point in world space?
yael
  • 21
  • 1
  • 2
1
vote
1 answer

openGL picking after glTranslate / glRotated

I wrote a pick function, to pick scene objects from the opengl canvas.…
chaitu
  • 699
  • 1
  • 9
  • 18
1
vote
1 answer

Unable to mouse pick a quad rendered in a framebuffer

Struggling to mouse pick a point/quad. I believe I am either using coordinates in the wrong space or perhaps not accounting for the framebuffer's position/size (it's a sub window of the main window). Tried converting to various different coordinate…
Jack
  • 39
  • 6
1
vote
0 answers

Mouse picking with ray casting in OpenGL?

I am trying to follow this tutorial regarding mouse picking in OpenGL but I am failing to get it to work properly. In my basic understanding to get world space coordinates from mouse coordinates I would need to multiply a bunch of inverse matrices.…
Jacky
  • 11
  • 1
  • 2
1
vote
0 answers

How to perform surface selection in threejs

For my project, I have to select an area (set of triangles) and on mouse hover event, I have to change the color. As an input, I have a list of area and the set of triangle ID. I use an indexed buffergeometry. I also set a color attribute in order…
Valimo Ral
  • 381
  • 2
  • 15
1
vote
1 answer

Raycasting (Mouse Picking) while using an Perspective VS Orthographic Projection in OpenGL

I am struggling to understand how to change my algorithm to handle raycasting (utilized for MousePicking) using a Perspective projection and an Orthographic projection. Currently I have a scene with 3D objects that have AxisAligned bounding boxes…
Short
  • 7,767
  • 2
  • 25
  • 33
1
vote
2 answers

Waiting for a matplotlib event in python 2.7

i have this code found here on StackOverflow and slighlty modified. import numpy as np import matplotlib.pyplot as plt import time x = np.arange(-10,10) y = x**2 x1 = 0 fig = plt.figure() ax = fig.add_subplot(111) ax.plot(x,y) plt.show() def…
1
vote
1 answer

OPEN GL ES 1.0. World coordinates to screen coordinates

For 3d-picking I planned to do this: -Get touch coordinates (x, y) -Choose vertex from vertex buffer of my model (xM, yM, zM). -Then project by my own hands (xM, yM, zM) on the screen coords (xM, yM, zM) ---> (xP, yP, ...) and then check match (for…
mihael.t
  • 11
  • 1
1
vote
1 answer

When i pick an object from the ground, my script does something unexpected

I'm currently working on a script that can pick up an item, and drop it with the click of the left mouse button. I'm also planning on addint rotating of an item and some icons to display whenever i do one of those actions. I'm currently very new to…
Athax
  • 75
  • 1
  • 6