Questions tagged [picking]

149 questions
2
votes
2 answers

OpenGL 3D Picking

I read many sample code about opengl picking. Nearly all of them use gluPerspective funcion for projection.I'm using glOrtho instead of gluPerspective function. And my Selection function is as below(DrawBuffer is my paint code): void Selection( int…
Merlin
  • 173
  • 7
2
votes
1 answer

Django cache.set() fails on a class with a GenericForeignKey, What can be the cause?

I have a model with a GenericForeignKey. When calling cache.set(key, trac_obj), it fails. I wonder if the GenericForeignKey is the culprit? # models.py class Trac(models.Model): user = models.ForeignKey(User, related_name="%(class)s",…
Val Neekman
  • 17,692
  • 14
  • 63
  • 66
2
votes
3 answers

OpenGL Picking with Pyglet

I'm trying to implement picking using Pyglet's OpenGL wrapper, but I'm having trouble converting a C tutorial to Python. Specifically the part below. #define BUFSIZE 512 GLuint selectBuf[BUFSIZE] void startPicking(int cursorX, int cursorY) { …
exupero
  • 9,136
  • 8
  • 47
  • 63
1
vote
2 answers

Best way to do mouse picking on randomly generated tiles

My main problem is I don't understand how to get the position of the generated tiles or how to tell where the mouse is. Should I use collision to detect mouse or something else? Is there something I can do to optimize my code and make it easier to…
Corey
  • 73
  • 4
  • 13
1
vote
0 answers

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 mouse. I have used picking method to control the racquet however the cursor is not on the racquet, it is about 10 cm away from the racquet. The racquet…
Ankit
  • 11
  • 3
1
vote
1 answer

Color picking in the openGL

i've been trying to implement color picking and it just aint working right. the problem is that if initially paint my model in the different colors that are used for the picking (i mean, i give each triangle different color, which is his id color),…
gal
  • 759
  • 1
  • 12
  • 26
1
vote
0 answers

WebGL picking points

I have trouble about picking points in 3D scene in WebGL. I found a example that is possible attach ID to each point through the RGBA components. It works but usually a point which is clicked is so far from wanted. I have point cloud of about 1.5mil…
spole340
  • 63
  • 3
1
vote
0 answers

Terrain picking in mapbox-gl-js

I'm using queryRenderedFeatures as the basis for a picking feature (like in here https://docs.mapbox.com/mapbox-gl-js/example/queryrenderedfeatures/). This approach provides a simple way of knowing which object is under the cursor, inspect its…
fnavarrog
  • 11
  • 1
1
vote
1 answer

Intersect picked Ray with shapes in OpenGL

I am trying to perform picking in OpenGL, and have 3 questions in 1. I use twice the Unproject command, once with 0 and once with 1 as near/end planes. Some article say that 0 and 1 are ok, some others say that I should use a calculated depth.…
Laurent Crivello
  • 3,809
  • 6
  • 45
  • 89
1
vote
1 answer

In OpenGL, how to pick an object by name stack when I use the VAO to draw objects?

I'm dealing with an old large project using fixed rendering pipeline, and the current project used the name stack to pick an object. Now I need to change one object in the project to the VAO (glDrawElements...) mode, while the other objects remain…
Ray
  • 61
  • 4
1
vote
1 answer

OpenGL/GLSL 4.5 - using MRT in the default FBO

I'm using MRT to resolve the 3D picking problem in OpenGL 4.5. (Reference link: http://ogldev.atspace.co.uk/www/tutorial29/tutorial29.html) According to the information I found online, we generally apply a new FBO when using the MRT. If so, I should…
Ray
  • 61
  • 4
1
vote
1 answer

Unity - How to react to scene picking? How to force select a parent by picking its child in the sceneview

I have the following situation I need an answer to: I have a parent object with children. These children all have unique meshes. Whenever these children are selected in the SceneView, the parent needs to be selected in stead. The children should…
1
vote
1 answer

SDL/Opengl Picking Question

Hi this might seem like a difficult question(or at least to me it is) but im using glUnproject and its not working. When i use the same function with OpenGL and Winapi it worked like a charm but now is not working when using OpenGl and SDL its…
Makenshi
  • 993
  • 3
  • 15
  • 28
1
vote
1 answer

picking the correct csv file

I'm new to python. I'd like python to pick the correct csv file from a folder. I'd like to compare CDS spreads from the most actual file (t) with yesterday's file (t-1). Hence, the Code has to choose today's file and the yesterday's file.…
Vitali
  • 11
  • 1
1
vote
2 answers

Problems with glReadPixels in android

I am trying to implement an opengl picking system I read about and have hit an issue with glReadPixels. Basically, every node in the scene gets a unique color and when a new touch happens, it renders the scene with nothing but the nodes painted with…
Jon Rose
  • 1,457
  • 1
  • 15
  • 25