Tagged Questions

A technique for using rays to determine points of intersection. Often used in lighting simulation.

learn more… | top users | synonyms (1)

0
votes
0answers
18 views

Ray casting problem using JOGL

I'm trying to port an old perfectly functioning ray casting implementation from my lwjgl project (FF pipeline) to a new project using JOGL and shaders. My problem is that my ray no longer intersects ...
0
votes
0answers
12 views

In libgdx, how do I get the intersection of a ray with a model instance?

I am using LibGDX trying to use raypicking to pick a point on a Mesh. I have two methods for this that don't seem to work quite right: /** * @param ray * @param intersection The vector to store ...
-1
votes
1answer
86 views

Unity 3D: Raycasting for gun hits

I am having trouble understanding raycast hits in Unity3D. I am trying to create an FPS game, so I have a gun, bullets and so on. My script for the bullets is: var Bullet : Transform; var Spawn ...
0
votes
1answer
45 views

Raycast doesn't point on the right direction

The raycast line im rendering is acting weird, it doesn't point where I want it to. I want it to point from the yellow object to the selected one but it draws it at another position. Here is my ...
0
votes
1answer
45 views

Raycast algorithm fails to collide with diagonal walls in specific locations

I'm having a problem with my ray-cast algorithm in a 2D tile-based universe. I feel the situation would be best explained with a picture, so here it is: The ray, represented by the blue line, is ...
0
votes
1answer
60 views

How do I raycast to detect which hexagonal tile was clicked?

I want to detect the hexagonal tile a unit is on upon clicking on the unit. I was thinking of using a ray cast I can't get it to work. I'm trying to get the raycast to shoot from the bottom of the ...
0
votes
0answers
51 views

Organization of world/eye/clip bounding volumes for ray picking

I currently have objects defined in world coordinates and also other "overlay" type objects defined in eye or clip space. I want to be able to select objects (ray picking) from both the overlay or ...
1
vote
1answer
171 views

(Three.js) - What object3D properties are required to make rayCaster.intersectObjects() work?

FYI, i am trying to do something almost identical to the following: Merging geometry/mesh without losing benefits I essentially have a list of Three.object3D's. These objects are "merged" together ...
0
votes
0answers
22 views

360-degree rotation/movement inside a tube [duplicate]

I'm trying to implement in UE4 the same gameplay mechanic Ballistics had: https://www.youtube.com/watch?v=UaJiPpLzbNg Working with splines doesn't quite cut it, because they have to be done ...
0
votes
0answers
50 views

(Unity 3D) Why are bone colliders with an Animator Controller so finicky?

I have an NPC with colliders parented to its bones using the Unity ragdoll wizard. It also has an Animator Controller. The problem is, sometimes those colliders just don't work right. They're targets ...
-1
votes
2answers
80 views

Libgdx, find Vector3 direction

I am using Libgdx along with Bullet physics. I have a vehicle moving. I would like to use a ray from the vehicles origin and in the vehicles forward direction. How can I create the forward Vector3 ...
0
votes
2answers
42 views

Converting A 3D Rotational Vector Into A 3D Forward Heading Vector

I need to do a raycast which accepts a Vector3D StartPos and a Vector3D EndPos. I have available to me the characters position and the cameras rotation in 3D vectors. I need to somehow compute a ...
-2
votes
2answers
143 views

AI shooting through walls [closed]

I made a AI shooting script for my new game but the problem is that the AI ignores the walls and shoots through walls. This is my ai script : #pragma strict public var rocketPrefab : Transform; ...
0
votes
1answer
134 views

Unity3d : Make prefab follow raycast hit

I've been trying to make a weapon script which fires a projectile (prefab) straight forward.I added to the bullet the first script shown here.And the second one to the main camera.The problem is that ...
2
votes
1answer
658 views

Orthographic Camera and Raycasting in Three.js

I'm working on a test project porting a simple game from iOS to Javascript. I've got the orthographic camera working and it can view the objects in the scene and move up and down the tower of meshes ...
0
votes
0answers
40 views

Mouse RayCast quadTree in XNa

Hallo i have quadTree terain and every quadNode have BBox.I have made function to return center of hitted quadNode BBox. But it's returns my bad calculations..... I have pitchedYawRoll camera ,it's ...
0
votes
1answer
298 views

Problem with Raycasting in a 2D Game

I'm new to using unity and came across a problem when I was following a tutorial. The game is in two dimensional space, and when my player walks over a certain tile the detection never goes off. ...
0
votes
0answers
108 views

Most efficient AABB - Ray intersection algorithm for input/output distance calculation

Thanks to the following thread : most efficient AABB vs Ray collision algorithms I have seen very fast algorithm for ray/AABB intersection point computation. Unfortunately, most of the recent ...
3
votes
1answer
175 views

Calculate the Intersection of Two Volumes

If you've ever played The Swapper, you'll have a good idea of what I'm asking about. I need to check for, and isolate, areas of a rectangle that may intersect with either a circle or another ...
0
votes
0answers
56 views

How to raycast select a scaled OBB?

I have the OBB picking code to select an OBB with code inspired from Real time Rendering 3 and opengl-tutorial.org. I can successfully select objects that have been moved or rotated. However, I cant ...
2
votes
1answer
154 views

Detect obstacles in path on a tile-based map

I'm creating a 2d game with a tile-based map, but smooth movement. I currently use A* in combination with some other tricks for pathfinding, and one issue what I've been dealing with is getting the ...
0
votes
1answer
577 views

How to find objects in front of my player

I am trying to find an object that is in front of my player sprite using the following code RaycastHit2D hit = Physics2D.Raycast(transform.position,Vector2.right,EnemyLayer); //EnemyLayer is the ...
1
vote
1answer
217 views

The correct way to transform a ray with a matrix?

Playing with XNA Triangle Picking Sample I found out that it does not work well if you scale the world matrix of the objects you want to pick. When I dug into the implementation I found this comment ...
0
votes
0answers
65 views

Libgdx get 3d intersection coordenate

Is there any algorithm that takes an arbitrary point coordinates as input and determines which is the 3d coordinate where the ray intersects the mesh? Use case: The mesh is rendered on the screen, ...
2
votes
1answer
182 views

How do I find voxels along a ray?

I am making a voxel engine, and I want to make it possible to create and destroy voxels with the mouse. I use C++ and OpenGL, so C++ examples would be best. So far, I have the camera position and ...
0
votes
1answer
134 views

Bounding Box in Monogame for mouse picking - Ray perspective

My mouse ray is screwing up precision. I don't really know how to fix it, maybe you guys can help. problem : (5.6mg gif) https://www.dropbox.com/s/v0z67afso88hsd1/perspective_ray.gif how i create ...
0
votes
1answer
179 views

Is this the correct way to detect ray-sphere intersection?

I have this java function that should return a true or false for any sphere passed to it if they intersect. However it seems to end being true a lot of the time when it shouldn't and false sometimes ...
0
votes
1answer
399 views

How does Raycasting work in XNA Farseer and player collision?

Wanting to know how to figure out if player's bottom is colliding with object so that I could allow the player to jump. I was trying to use OnCollision but was referred to ray-casting, I looked ...
0
votes
1answer
1k views

Platformer raycast collision detection

I'm using Unity to create a 2D platformer. For collision detection, I'm using raycasting to detect any possible collisions with specific collision layers, and adjusting the desired delta x & y ...
0
votes
2answers
188 views

Thick Ray interaction with AABB

I would like to intersect a thick ray (actually a cylinder) with an AABB. The current code to perform intersection with the ray is the following. template <class RealT> bool ...
4
votes
1answer
233 views

How can I ensure field of view symmetry in a Roguelike?

I'm working on a Roguelike, and for it I've created a ray-tracing/casting field-of-view (FoV) algorithm that consists of plotting Bresenham lines to every point in a solid circle. It's artifact free ...
2
votes
3answers
311 views

Strategy for detecting hits from a “cylinder ray”?

I was planning on using ray casting for collision detection in my game. However, when I use an attack similar to this: (which would project something like a cylinder), how would I go about ...
2
votes
1answer
282 views

Ray picking and bounding boxes in Java

How do I check which bounding boxes (of different types) a ray, sent from the camera through the mouse-click coordinates, intersects with first in Java (and where)? I have arrays (box_X, box_Y, box_Z, ...
0
votes
0answers
161 views

Block picking / ray casting through 3d blocks always slightly off

I've been working on adding a line-of-sight/ray-tracing system to my 3d block-world game. I've tried several different methods and they all work fairly well. At the moment I'm using something similar ...
2
votes
1answer
192 views

Are ambient, diffuse and specular light or material properties?

Are ambient, diffuse and specular properties of light or material? I am doing ray casting in OpenGL, I've managed to create lit sphere using formula I = L Ka + L Kd (n . l) + L Ks (r . v)^n but I ...
3
votes
1answer
652 views

box2d raycast filter category

I am trying to filter a category in my ray casting (jBox2D within libGDX), which should return the closest object that does not belong to the category LEVEL0. I've tried a plethora of approaches, but ...
1
vote
0answers
262 views

How to identify whether the boundingvolume intersects with walls or floor when it doesnt return normals?

My game in jMonkey is the kind that use will have to place objects in a scene (which consist of walls and slabs and floor). All my models are centered at origin. When the user click a point I use ray ...
0
votes
1answer
138 views

How to place an object so that it does not overlap the objects in my scene?

In my game, the user has to click at a point to place an object (mesh). I can cast a ray and find the horizontal point where the object can be translated and then attached to rootNode to display it. ...
0
votes
0answers
232 views

LWJGL Mouse picking when camera rotated

I have third person camera in my game and I have mouse picking which works not so good. It works good only when yaw rotation is lesser than ~75 if yaw is greater than 75 then it fails.. Here is video ...
2
votes
0answers
90 views

Corona SDK Live RayCasting [closed]

I'm looking for help involving rayCast in Corona SDK. If you haven't see it here's a link talking about it along with a demo. WEll in the demo you tap on a space and the ray is recasted and bounced if ...
0
votes
1answer
185 views

Volume raycaster problems HLSL

Hi this is my first question here so if I fail to include some necessary piece of information please dont rip my head off. ^^ I can't seem to get my volume raycaster to workt properly. I've been ...
4
votes
3answers
485 views

How to check whether a ray cast hits a specific side of an object?

I am using Ogre3d to develop a 3d simulation/game. One task is to determine whether the user has focused the camera on a specific object. So I cast a ray from the camera to what is currently in the ...
0
votes
1answer
111 views

3D drawing precision problem. XNA

I have a simple scrolling camera positioned 2000 units about the 3D 'floor' that moves forward by 1 unit every frame and looks down on the floor at a point that also moves forward by 1 unit every ...
0
votes
1answer
406 views

How can I remove the view and projection matrix from ray position to get only the ray model?

I've got a little problem with my picking module and I need your help. I have a method to project a ray from the camera to a fixed point when I click somewhere. The computed ray looks good, it go to ...
-1
votes
1answer
125 views

Ray picking gives inversed results

I'm trying to do a simple ray picking implementation to allow a user to select a cell in a grid rendered in 3D. I'm almost there, but I've ran into an issue which I can't seem to solve. Consider the ...
7
votes
3answers
3k views

How do I implement occluded lighting in a block-based 2D game?

I want to have 2D lighting that can be blocked by in-game objects. My game has a top-down view and all game objects are described by rectangles. Let's say I have a 10x10 world and I place a light at ...
8
votes
2answers
417 views

Diagonal line of sight with two corners

Right now I'm using Bresenham's line algorithm for line of sight. The problem is I've found an edge case where players can look through walls. Occurs when the player looks between two corners of a ...
1
vote
1answer
206 views

Quick 3D sight calculation algorithm

I have a tile based board game where units move in 3D space on a 2D isometric view. When calculating attack tiles for a unit, how do I verify that they aren't shooting through a wall or a level too ...
1
vote
1answer
397 views

Ray Tracing in 3D - generating a ray

A ray is shot from the camera eye to the camera screen at point (i,j) how do I get the coordinates of that point in 3D world coordinates? The best I could find online is for point S S = Q + au + bv ...
0
votes
3answers
172 views

Keeping raycast on the same level

I want my raycast to end at certain height(red line). But as the game is 3D and the camera rotates I can't use a fixed magnitude. What I thought was a stroke of genius, I figured I'd project the ...