picking

Three.js picking is not working correctly with custom geometry

北慕城南 提交于 2019-12-23 05:59:30
问题 I have a problem with picking implementation. I found a number of different examples doing what I want, but I really cannot make it work as it should. I mainly followed this example Basically, I have some meshes in my scene and, double clicking any of them, I'd like to change the color of the chosen one. In the scene there are 3 small cubes that are always selected and some more complex meshes that often aren't. I'd like to know if anybody can help me figuring why, if the cubes can be

iOS 5 + GLKView: How to access pixel RGB data for colour-based vertex picking?

梦想的初衷 提交于 2019-12-18 10:57:19
问题 I've been converting my own personal OGLES 2.0 framework to take advantage of the functionality added by the new iOS 5 framework GLKit . After pleasing results, I now wish to implement the colour-based picking mechanism described here. For this, you must access the back buffer to retrieve a touched pixel RGBA value, which is then used as a unique identifier for a vertex/primitive/display object. Of course, this requires temporary unique coloring of all vertices/primitives/display objects. I

Android OpenGL 3D picking

倖福魔咒の 提交于 2019-12-18 02:54:50
问题 I'm on Android OpenGL-ES 2.0 and after all the limitations that come with it, I can't figure out how to take 2D screen touches to the 3D points I have. I can't get the right results. I'm trying to implement shooting a ray into the point cloud, which I can then compare distances of my points to the ray, finding the closest point. public class OpenGLRenderer extends Activity implements GLSurfaceView.Renderer { public PointCloud ptCloud; MatrixGrabber mg = new MatrixGrabber(); ... public void

Picking in java 2d

二次信任 提交于 2019-12-14 01:27:19
问题 I am using java2d to draw a simple graph at the moment I have implemented picking by calling contains(MousePoint) for each object/shape, this works but scales linearly. Is there a more efficient method for picking in java2d? 回答1: Yes, although the full answer would be too long for this space. First of all, unless you have a lot of nodes, then linear will most likely be fine, and you shouldn't change anything unless performance is already seen to suffer. Second, what you want, in general, is

Best box selection method for a Minecraft clone

核能气质少年 提交于 2019-12-12 10:46:43
问题 I'm making a Minecraft clone as my very first OpenGL project and am stuck at the box selection part. What would be the best method to make a reliable box selection? I've been going through some AABB algorithms, but none of them explain well enough what they exactly do (especially the super tweaked ones) and I don't want to use stuff I don't understand. Since the world is composed of cubes I used octrees to remove some strain on ray cast calculations, basically the only thing I need is this

How would you solve this opengl necessity (in c) involving knowing in which square in a boardgame did the user click?

佐手、 提交于 2019-12-11 00:06:06
问题 So I have this board, to play a boardgame... The problem is, how do I know in which square did the user click on? I know the x and y coordinates, but how do I automate it, without the need to hunt down the specific locations of each square. (Also the size of the board is variable...so it can have lots of squares, or very few, but the board has always the same height and width, that is, the same number of squares running from left to right as the number of squares running from top to bottom).

Generic picking solution for 3D scenes with vertex-shader-based geometry deformation applied

谁说我不能喝 提交于 2019-12-07 08:42:54
问题 I'm trying to implement a navigation technique for 3D scenes (in OpenSceneGraph with OpenGL). Among other things the user should be able to click on an scene object on the screen to move towards it. The navigation technique should be integrated into another project which uses a vertex shader to apply a global deformation to the scene geometry. And here is the problem: Since the geometry is deformed using a vertex shader, it is not straight forward to un-project the mouse cursor position to

OpenGL ES color picking on the iPhone

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-06 06:13:17
问题 I'm looking into 3D on the iPhone, I have managed to get a 3D cube on the device but would like to add interactivity such as touching one face fires a specific event and an other face a different event. I'd rather steer clear of ray picking as this adds extra complexity that I do not want in my app. I've read up on quite a few color picking tutorials, but there doesn't seem to be any iPhone specific tutorials or sample code anywhere on the web. My main problem is drawing unique colored

Generic picking solution for 3D scenes with vertex-shader-based geometry deformation applied

老子叫甜甜 提交于 2019-12-05 16:34:34
I'm trying to implement a navigation technique for 3D scenes (in OpenSceneGraph with OpenGL). Among other things the user should be able to click on an scene object on the screen to move towards it. The navigation technique should be integrated into another project which uses a vertex shader to apply a global deformation to the scene geometry. And here is the problem: Since the geometry is deformed using a vertex shader, it is not straight forward to un-project the mouse cursor position to the world coordinates of the spot the user actually selected. But I need those coordinates to perform the

iOS 5 + GLKView: How to access pixel RGB data for colour-based vertex picking?

戏子无情 提交于 2019-11-30 00:58:08
I've been converting my own personal OGLES 2.0 framework to take advantage of the functionality added by the new iOS 5 framework GLKit . After pleasing results, I now wish to implement the colour-based picking mechanism described here . For this, you must access the back buffer to retrieve a touched pixel RGBA value, which is then used as a unique identifier for a vertex/primitive/display object. Of course, this requires temporary unique coloring of all vertices/primitives/display objects. I have two questions, and I'd be very grateful for assistance with either: I have access to a