Questions tagged [mouse-picking]

77 questions
2
votes
1 answer

Can I read single pixel value from WebGL depth texture in JavaScript?

In short I would like to read a single pixel value from a WebGL 2 depth texture in JavaScript. Is this at all possible? The scenario I am rendering a scene in WebGL 2. The renderer is given a depth texture to which it writes the depth buffer. This…
Berthur
  • 4,300
  • 2
  • 14
  • 28
2
votes
2 answers

Java mouse picking on diamond tiled map

Ok, im at my wits end. I am trying to create a small isometric tile map thats bigger then the screen witha viewpoint i can modify with mouse dragging. I got the drawing right (i think), i got the dragging working, just do't seem to be able to get…
Ryu Kajiya
  • 255
  • 1
  • 3
  • 16
2
votes
0 answers

Camera and mouse-picking difficulties

Im working on a chess game which is in 3D space. Im trying to figure out how I could move the figures around but camera and different mouse modes are giving me a headache. Here is an example screenshot: The Idea: There are 2 camera/mouse input…
Hentairino
  • 111
  • 7
2
votes
1 answer

OpenGL Mouse Picking Strategy

I am using OpenGL to render a model of an object that is rotationally-symmetric in a given plane, and I want the user to be able to scroll over the model (possibly after rotations, zooms, etc.) and determine what world coordinate on the model the…
seveland
  • 181
  • 12
2
votes
1 answer

Color coded picking problem in OpenGL

I am making a game, actually a very basic replica of Minecraft, for a class project of mine. I'm stuck in the picking process right now, which would enable me to destroy and create blocks in the game environment. I've been trying to use OpenGL's own…
Dunya Degirmenci
  • 365
  • 4
  • 20
2
votes
3 answers

XNA 2D mouse picking

I'm working on a simple 2D Real time strategy game using XNA. Right now I have reached the point where I need to be able to click on the sprite for a unit or building and be able to reference the object associated with that sprite. From the research…
APalmer
  • 919
  • 3
  • 11
  • 22
2
votes
1 answer

What is the relation between View Space & NDC?

I want to transform a picking ray from screen space coordinates to view space, for picking purposes, in DirectX 11. Below is a part (from "Introduction to 3D Game Programming with DirectX 11" by Frank D. Luna) explaining this transform. I don't…
2
votes
1 answer

gpu picking - invisible pixels around sprites

I'm rendering a picking scene that contains sprites. As my cursor gets close to the sprite, it registers as a color and gets "picked". This invisible border gets larger closer you zoom into the sprites. Open up your console to see the IDs printed…
Jared
  • 607
  • 1
  • 6
  • 28
2
votes
0 answers

Three.js boids - improving mouse detection with a changing camera position

I've been working with three.js examples of boids/flocks for some time, but both the canvas one and the webgl/shaders one have a flaw: the mouseOver event (which "disturbs" birds and triggers a repulsion) only works when camera.position = {x: 0, y:…
2
votes
2 answers

How to get accurate 3D depth from 2D screen mouse click for large scale object in OpenGL?

I am computing the 3D coordinates from the 2D screen mouse click. Then I draw point at the computed 3D coordinate. Nothing is wrong in the code, nothing is wrong in the method, everything is working fine. But there is one issue which is relevant to…
maxpayne
  • 1,111
  • 2
  • 21
  • 41
2
votes
2 answers

Best way to drag 3D point in 3D space with mouse picking in OpenGL?

What is the best way to drag 3D point with mouse picking. Issue is not the picking but to dragging in 3D space. There are two ways I am thinking, one is to get the View to World coordinates using gluUnProject and translate the 3D point. The problem…
maxpayne
  • 1,111
  • 2
  • 21
  • 41
2
votes
1 answer

Create ray from mouse coordinates for 3D picking

My Question Can someone please link a good article/tutorial/anything or maybe even explain how to correctly cast a ray from the mouse coordinates to pick objects in 3D? I already have the Ray and intersection works, now I only need to create the…
Big_Chair
  • 2,781
  • 3
  • 31
  • 58
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
  • 12,589
  • 9
  • 47
  • 59
2
votes
1 answer

Mouse-picking using off-screen rendering?

I have 3d-scene with a lot of simple objects (may be huge number of them), so I think it's not very good idea to use ray-tracing for picking objects by mouse. I'd like to do something like this: render all these objects into some opengl off-screen…
nanenaro
  • 103
  • 10
2
votes
0 answers

latitude longitude on sphere in three.js

I have a globe in threeJS that can be rotated in any direction. As it is currently, I can read the correct longitude and latitude located at the center of the globe regardless of rotation. The globe is orientated so that the raycaster.ray.origin.x…
Joshua W
  • 1,537
  • 2
  • 12
  • 15