Questions tagged [raycasting]

A rendering technique to create a 3D perspective in a 2D map

1193 questions
6
votes
0 answers

Fish-eye effect corrections in JavaScript ray-caster engine

I am building a ray-casting engine in JavaScript using the canvas, I've built the ray-caster and its fully working, except for one problem, there is a fish-eye effect, I tried doing corrections var d = (Math.sqrt( Math.pow((rays[i].x -…
Ryan Grube
  • 185
  • 1
  • 11
6
votes
2 answers

Unity3D: Bouncing/Reflecting Raycast

Hey everyone thanks for the help, What I am trying to do is fairly straight forward, I am trying to display a Line Renderer that follows my bouncing/reflecting Raycast. Here is what I have so far. private LineRenderer lr; public int…
NeatMaddness
  • 85
  • 1
  • 6
6
votes
1 answer

Unity3d Billiard/Pool aiming issue

I'm trying to calculate what angle to hit a pool ball and predict where ball will go to.. I thought target ball should move within a normal direction.. but it moves on totally different direction RaycastHit2D hit =…
6
votes
1 answer

Three.js ray casting for particular Points

I'm working on a network visualization using Three.js and am having trouble determining why my ray casting implementation is not identifying the correct points (Full example and source). More specifically, I'm trying to use ray casting with a Points…
duhaime
  • 25,611
  • 17
  • 169
  • 224
6
votes
1 answer

Compute 3D point from mouse-position and depth-map

I need to compute 3D coordinates from a screen-space position using a rendered depth-map. Unfortunately, using the regular raytracing is not an option for me because I am dealing with a single geometry containing something on the order of 5M…
Martin Schuhfuß
  • 6,814
  • 1
  • 36
  • 44
6
votes
2 answers

Raycast to boundingBox of TextGeometry rather than the mesh

I'm trying to raycast to TextGeometry's boundingBox. Currently, raycasting works for textGeometry when click is on the letters not around or inbetween letters. If the click is inbetween the text letters/aphabets, no object is intersected with…
avg
  • 121
  • 4
6
votes
1 answer

Clickable particles in three.js PointCloud

I am visualizing 3d data points (which I read in via a csv-file) with the help of three.js. I want to click on points in that PointCloud to show other measurement data for those specific points. According to examples I found this is possible…
Mika Prouk
  • 495
  • 5
  • 16
6
votes
2 answers

RayCasting in Libgdx 3d

Alright so I've been trying for quite some time too Raycast in libgdx for 3d collision detection based on where im looking.. But I've drawn a blank and doesn't seem to be any documentation anywhere. Would someone be kind enough to send me in the…
user3534018
6
votes
1 answer

Three.js Ray Casting for Collision Detection

I'm trying to draw a line using ray casting. Basically I want to set up some lines coming from my "player" object out in all directions. (like so:…
james
  • 1,031
  • 1
  • 15
  • 31
5
votes
3 answers

Raycast from Camera to Mouse Position in Game World

When the mouse is at the Door (red area) i want to do something. I am trying to cast a Ray but the Ray doesn't hit the Door and i cant find where exactly it is hitting. Also how can i Debug.DrawRay this ray? Ray ray =…
Gerte
  • 97
  • 2
  • 4
  • 9
5
votes
1 answer

How to identify click inside the 3D object or outside 3D object using near and far positions

I am working in 3D object rendering using OpenGLES 2.0 with Android,Java code.How to identify click inside the 3D object or outside 3D object using following code near and far positions? public static PointF screenToWorld(float[] viewMatrix, …
Ramprasad
  • 7,981
  • 20
  • 74
  • 135
5
votes
1 answer

Unity Physics.Raycast does not seem to properly detect object it hit

I have a GameObject that implements IDragHandler and IDropHandler from UnityEngine.EventSystems. In OnDrop, I want to check, has this object been dropped in front of another object. I'm using Physics.Raycast, but it only returns true in some cases.…
Helena
  • 1,041
  • 2
  • 12
  • 24
5
votes
1 answer

Line Intersection with rotated box collider object

I'm implementing my own Raycasting library to learn how it works. As a starting point I have a box that rotates and, using rays, detects the different obstacles that it encounters in its way. Worth mention: I have this working using the line AABB…
5
votes
1 answer

Box2d raycast vs AABB query performance

I'm currently trying to improve performance of a game that makes use of box2d physics (actually box2dlights). I have a method that makes several (let's say about 16 to 64) raycasts within an known area. I wonder if it would be a good idea to make an…
Sebastian
  • 5,721
  • 3
  • 43
  • 69
5
votes
3 answers

Three.js: "select tool" How to detect the intersection of a 2D square and 3D objects

Basically what i want to create: I have a 3D map with objects, i want to select all objects that are in the 2D box x1,y1 to x2,y2 on my screen. Any ideas how this has to be done, because i'm clueless on how to start. Thanks in advance! prevX and…
Captain Obvious
  • 745
  • 3
  • 17
  • 39
1 2
3
79 80