2
votes
1answer
71 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
88 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
59 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 ...
-1
votes
0answers
46 views

Ray casting not checking in front of sprite

I posted this on stack overflow and didn't get many responses, maybe this exchange is better suited. I rotate my sprite to make sure its facing the direction its going like this in my update method: ...
0
votes
0answers
23 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
116 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
43 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
95 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
118 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
206 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
162 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
157 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
151 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
163 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
91 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
142 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 ...
2
votes
1answer
412 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 ...
0
votes
0answers
33 views

bounding box of objects reflected in a surface

I'm interested in a subset of ray-tracing functionality. Specifically, I have a mirror surface (specified as some bidimensional surface, as of yet with no specified implementation, maybe some ...
1
vote
0answers
129 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
128 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
177 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
64 views

Corona SDK Live RayCasting

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
147 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
323 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
87 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
325 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
104 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 ...
6
votes
3answers
2k 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
335 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 ...
0
votes
1answer
145 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
259 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
132 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 ...
0
votes
1answer
272 views

Displaying sprites in a 2.5D raycasting engine

I'm developing a raycasting engine like the one used in DOOM, Wolfenstein 3D, etc. My engine is capable of correctly displaying walls and textures on walls, but I'm stuck at sprites rendering. Given ...
4
votes
1answer
2k views

More efficient way to implement Line of sight on a 2d grid with ray casting?

Consider a 2d grid of tiles, and an approximated sphere of coordinates - centered on the player - that represents line of sight. The goal is to block the line of sight beyond obstacles (ie walls). ...
9
votes
4answers
2k views

Cast ray to select block in voxel game

I am developing a game with a Minecraft-like terrain made out of blocks. Since basic rendering and chunk loading is done now, I want to implement block selecting. Therefore I need to find out what ...
2
votes
1answer
666 views

Raycasting “fisheye effect” question

Continuing my exploration of raycasting, I am very confused about how the correction of the fisheye effect works. Looking at the screenshot below from the tutorial at permadi.com, the way I ...
1
vote
0answers
81 views

Performance issues with visibility detection and object transparency

I'm working on a 3d game that has a view similar to classic isometric games (diablo, etc.). One of the things I'm trying to implement is the effect of turning walls transparent when the player walks ...
4
votes
1answer
878 views

Raycasting tutorial / vector math question

I'm checking out this nice raycasting tutorial at http://lodev.org/cgtutor/raycasting.html and have a probably very simple math question. In the DDA algorithm I'm having trouble understanding the ...
8
votes
3answers
763 views

Narrow-phase collision detection algorithms

There are three phases of collision detection. Broadphase: It loops between all objecs that can interact, false positives are allowed, if it would speed up the loop. Narrowphase: Determines whether ...
1
vote
1answer
865 views

Problems implementing a screen space shadow ray tracing shader

Here I previously asked for the possibility of ray tracing shadows in screen space in a deferred shader. Several problems were pointed out. One of the most important problem is that only visible ...
1
vote
2answers
518 views

Raycasting mouse coordinates to rotated object?

I am trying to cast a ray from my mouse to a plane at a specified position with a known width and length and height. I know that you can use the NDC (Normalized Device Coordinates) to cast ray but I ...
0
votes
2answers
270 views

Wavefront mesh: determine which face a point belongs to?

I have a 3D mesh Wavefront .obj file. Is there any algorithm that takes an arbitrary point coordinates as input and determines which face of the mesh that point belongs to ?? The mesh is rendered on ...
-2
votes
1answer
628 views

Ray casting on a mesh using libgdx [closed]

I'm trying to perform ray casting on a mesh using libgdx. I found this code sample and it misses some explanations. What do these vectors stand for? What is globalIntersection and localIntersection?
1
vote
1answer
144 views

Looking for a library to create a grid based first person game online

Before I go and build it myself, I have been looking for a library that may help making a grid based first person view similar to: https://www.youtube.com/watch?v=GwmZoCFd4Us I plan to make a web ...
6
votes
1answer
2k views

Why doesn't Unity's OnCollisionEnter give me surface normals, and what's the most reliable way to get them?

Unity's on collision event gives you a Collision object that gives you some information about the collision that happened (including a list of ContactPoints with hit normals). But what you don't get ...
2
votes
1answer
331 views

OpenGL 3+ Range Picking

How do I perform range picking in the latest OpenGL version? By range picking I mean selecting all objects which are picked using a selection rectangle, like in an RTS game. For single object picking ...
1
vote
2answers
2k views

How to handle 3D collisions using raycasting (with a reflection vector?)

I'm making a game using THREE.JS, and I want my character to walk on the terrain, and collide with static 3D objects (=AABB boxes) that are on that terrain. The problem is: THREE.JS has only a ...
1
vote
1answer
2k views

Raycasting Collision Detection

I need to check for collisions when firing a bullet, but I have a few questions first. My game is 2D and tile based, it also uses the XNA framework. From what I've read raycasting or continuous ...
0
votes
1answer
129 views

Is it safe to cast my 2D points to 3D points for a library which only takes Vector3s?

I need to cast a ray in 2D space for bullet collision detection, but the Ray.Intersects method requires a BoundingBox which uses vector3's not vector2's. My question is should I just ignore the Z ...
2
votes
1answer
330 views

What is an easy way to work subsurface scattering into a raycaster?

I've got some neat effects with path tracing: I want to add in an ability to do subsurface scattering, but I'm unsure of the general algorithm. With path tracing, it's: foreach pixel: trace( ...