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

learn more… | top users | synonyms (1)

0
votes
2answers
35 views

Pool game ball path line

I'm using Unity C#. How would I create the effect in my pool game, a line showing the direction of the second (not white) ball after collision. Example: I need to make the line coming from the ball ...
0
votes
1answer
38 views

How do I ground my character using capsule colliders?

I have a problem checking if my character is grounded, and it is tied to the position of the capsule collider. I just started using Unity, so I'm not sure what I did wrong. The problem is that the ...
0
votes
1answer
23 views

Raycast2D ray not follow object

I have some Raycast2D problem. I want raycast follow the object like this: But when I drag object somewhere the ray looklike this : Here is my code where is my fault. Please help :( using ...
0
votes
0answers
51 views

A line algorithm with anti-aliasing for 2D LOS

I've been searching for hours on end for a working line algorithm with anti-aliasing for line of sight or field of view in my game (mixed with raycasting). I've found numerous algorithm's and ...
0
votes
0answers
68 views

Voxel clouds rendering in Unity

I would like to have realistic voxel clouds in Unity game - I found a very promising article on fast fluid simulations, however the the output of the algorithm itself is 3D grid of cloud densities (=...
0
votes
1answer
113 views

Raycasting with a selection rectangle box

I'm currently making a level editor for my game and want to implement a selection tool to make it easier to select multiple voxels at once. My question is what the most efficient way is to get all the ...
1
vote
1answer
105 views

Line vs Triangle wrong computation

I used the Möller-Trumbore algorithm. That seemed to work for a while but I found a bug: const glm::vec3 avert0 = glm::vec3(-0.13f, 0.01f, 0.0f); const glm::vec3 avert1 = glm::vec3(-0.01f, 0.01f, 0....
-1
votes
1answer
41 views

Modify raycast?

In my script, the raycast starts from a camera, and moves forward. I need to modify it to make it start from a bit far from the camera, without changing the direction. Vector3 fwd = transform....
1
vote
2answers
63 views

Unity - UI Raycast Hits Problem

I'm having a hard time getting a UI to work and I'd love some advice on what I'm doing wrong. I have a GameObject (P1 below) which holds a hand of cards (a script containing an array of GameObjects). ...
0
votes
0answers
32 views

Finding the intersection of a plane and a ray

There are many formulas to check a ray against an unbounded (infinite) plane. Is there any way to quickly check if a ray goes through a bounded plane (i.e. a surface)? I currently have a plane ...
-1
votes
1answer
48 views

FInd out if AABB is left/right/below or obove a ray

What algorithms are there to find out in which quadrant of the ray an AABB is given a roll value? My idea was to rotate the cube by the negative rotation of the ray and move it by the negative ...
1
vote
1answer
95 views

Collision detection C++

I'm currently trying to make a small ball-like game in C++. I have two disc-like objects with varying radii. Let's say Disc 1 is on coordinates (100,0) and Disc 2 is on coordinates (400,0). Now Disc 1 ...
0
votes
2answers
32 views

Raycasting to AddForceAtPosition goes to the wrong direction

I'm trying to get my coin object's Rigidbody to move whichever way it was swiped on by the user through RayCast void Awake() { coinRigidBody = coin.GetComponent<Rigidbody>(); } void Update(...
0
votes
0answers
71 views

Unity Physics 2D Raycaster does not work

The version of unity I'm using is 5.5.0a6. I have a script that intercepts OnPointerClick, OnPointerDown and OnPointerUp events. My camera has the forementioned componend attached to it and my scene ...
0
votes
1answer
29 views

Raycast implementation in order to optimizate collision-detection

I want to know if a gameobject (a plane) is facing another one to prevent collisions. Right now I have an array that contains all planes in the scene and, for each one, compare position in order to ...
0
votes
1answer
40 views

Xna c# picking model with Ray mouse cursor select the wrong model

i made a small 3D game and i just try to apply a basic sample from here : http://rbwhitaker.wikidot.com/picking for picking model by the mouse cursor. For that i use the Ray object and check if some ...
0
votes
0answers
57 views

Is this 2D light implementation with shaders good enough?

After some days reading and programming shaders in GLSL (and Allegro 5) I came up with the stages I will be using to render the lights in my 2D test game. My first goal is to reach something like what ...
0
votes
0answers
55 views

OpenGL raycasting and Intersection with triangles issues

This is my previous question which has bothered me for a while and I still haven't figured out (also no-one answered), so I am posting again on a related-issue which I have been working on hoping to ...
0
votes
1answer
47 views

Simultaneous line of sight for hundreds of individual agents on a grid?

I have a large grid with hundreds of individual agents, each of which is moving around based on its own visual inputs and a fast control algorithm. My question is: How can I efficiently provide each ...
0
votes
0answers
38 views

Pick a line on a mesh

I am trying to gather all the indices hit by my mouse pointer while I am pressing the left mouse button and display it on the mesh as a line. So we have this plane: https://puu.sh/rYOIG/c55077d713....
0
votes
1answer
27 views

Code reading difficulties with raycasting engine

I'm trying to teach myself to program some basic engines. I've been following this tutorial: http://www.playfuljs.com/a-first-person-engine-in-265-lines/ to get a decent idea of a basic way to render ...
0
votes
2answers
89 views

If raycast hit nothing my object stay at end of the ray?

How to make an object stay at end of the raycast if the ray hit nothing ?! Here is my script using UnityEngine; using System.Collections; public class ray : MonoBehaviour { public float howFar; ...
0
votes
1answer
62 views

Use raycast to fix bullet's direction?

Player cam has a raycast. I need it to work as pointer for player's bullet direction. If the ray hits any kind of object this spot will be the aim of player's bullets. Here is my script public ...
2
votes
2answers
126 views

How to avoid 2d enemy to see through walls

I am using RayCastCallback to detect the line of sight. So I the enemy avoid seeing the player through walls, problem is there's a limited field of view. So I added another two rays to the left and ...
0
votes
0answers
37 views

Strange raycast hit

I'm doing a raycast from the origin (0.0, 4.0, 87.5) with the direction (0.0, 1.0, 0.0). The max distance is 1.5. In my scene this space is empty, although I'm getting a hit at (0.0, 5.0, 87.5), and ...
0
votes
2answers
65 views

Unity3D: Find Raycasthit direction

I'm trying to make a Billiard game and I wanna calculate the direction on which the Cue Ball(white ball) will be moving after it hits another ball. As you can see I wanna calculate the angle/...
0
votes
1answer
46 views

Moving left and right not working as expected

I've been trying to get this working for about 2 hours now and as far as I'm concerned, it is working entirely, other than one thing. The problem is that when my player is in the air, and they move ...
0
votes
0answers
44 views

Does light source color defines its radiance?

My understanding is that a light source can emits wavelength in red colour; and the same red light source (viewed from the same angle) can have more intensity if it emits much more light flux and ...
0
votes
0answers
43 views

Dark image on Stochastic path tracing

I am trying to implement stochastic path tracing, where direct and indirect illuminations are evaluated separately. Below is an example of the direct illuminance with 4 rays per pixel and 16 shadow ...
3
votes
4answers
273 views

Determining how much of a tile is intersected by a ray to help calculate lighting and deal with shadow issues

I'm currently using the following steps for my lighting system Calculate all the tiles along the perimeter based on the radius of the light Cast a ray from the center of the light to each perimeter ...
1
vote
1answer
114 views

Unity C#: Using Linecast with collider bounds

I'm trying to to detect when two 3D objects overlap each other 'visually' without actually touching. For example, if I have two spheres in a scene that are 1 meter apart and I rotate my camera around ...
0
votes
1answer
56 views

In a simple raycasting engine, why is the distance between player and the projection plane remains constant?

According to this article about making a simple raycasting engine (like the one that was used in Wolfenstein3d), the distance between the player and the projection plane will be constant. For ...
0
votes
1answer
172 views

Unity: OnTriggerEnter2D does not get called when using Raycast

In a previous post I talked about creating wires (using Bézier curve) using LineRenderer. I am using a PolygonCollider2D to wrap the wire (see below): GameObject wire = new GameObject (); ...
3
votes
1answer
146 views

Unity: What type of Collider should I add to a LineRenderer?

I am currently building a game where I need to generate some wires (as Bézier curves) using LineRenderer. After changing the width of each line lineRenderer.SetWidth (0.15f, 0.15f); I am attaching ...
0
votes
2answers
114 views

Raycast not working on touchscreen (Android tablet/phone)

I have a raycast that works in the unity editor but not when I build it for Android( tablet or phone, neither work). The code I'm using is as follows: public class DirectionalTilePlacing : ...
0
votes
1answer
55 views

Raycasting against my plane does not detect collisions in Unity

I'm trying to keep the camera above a plane which acts as the ground, so I wrote this bit of code: RaycastHit hit; if (!Physics.Raycast (transform.position, new Vector3 (0, -50, 0), out hit, 5)) { ...
8
votes
3answers
1k views

How to handle RTS Click-And-Move in 3D Space?

How can I handle the click-and-move in a complete 3D space? It is easy to handle on a 2D plane by a simple raycast, but this is not the case in 3D since there is no end-plane for a raycast to get an ...
2
votes
0answers
94 views

SFML Raycasting Problem: Textures not displaying propely

I have been lurking on gamedev.Stackexchange for a while now and finally have a question to ask. I have been working on a simple raycasting engine (like wolfenstein 3d) using the SFML Graphical ...
1
vote
0answers
91 views

Retreive 3d World Map coordinates from touch/click input with LIBGDX?

Problem: I am trying to create an RTS style interaction. I want to be able to click on the map and have characters move to the click location. I haven't been able to figure this out, even after ...
0
votes
2answers
72 views

Raycast will not hit generated box colliders at initialization

In my map class I have an algorithm that is generating and merging box colliders together. These belong to the layer "Ground". After that, in some places on my map I'm generating some new cubes on-...
0
votes
2answers
81 views

How to Ignore Raycast for Boxcollider2D by layer or boolean?

How do I ignore raycasts for specific objects? I want a filter, to ignore raycasts for some objects. As an example, when my player selects the ground, I do not want them to accidentally select ...
2
votes
0answers
144 views

Unity raycast misses convex mesh collider

I have a bunch of fighter AIs that are doing attack runs on a target (Currently just a cylinder). It is designed to veer off course the moment it gets too close and loop around for another attack ...
0
votes
0answers
145 views

Floor casting in a Raycasting engine

I'm trying to create a pseudo 3D, raycasting engine with plain JavaScript rendered on the HTML5 canvas. In short: a Wolfenstein 3D clone. So far I have gained inspiration from the following guides: ...
0
votes
1answer
166 views

Project camera-to-pixel ray in world coordinates

I'm trying to implement a very simple ray tracing function but I have a problem with projecting the camera ray (from camera to pixel) to the world space. In the screen coordinates have the pixel ...
2
votes
1answer
219 views

How to get color or value from material with shader?

I have a sphere with a shader with colors for specific heights and I want to get the value at the cursor(height) or color of the point the cursor is on when clicked. Is there a good way to get this ...
0
votes
2answers
43 views

Script no longer working now that it is attached to a child object. Why is this?

So I decided I wanted to make this script part of a separate swap-able weapon so I made a child and put the script there. Before the script worked fine but now it won't work. The script works as ...
1
vote
1answer
145 views

Checking if point is inside the mesh via raycasting - where to cast rays?

I need to voxelize triangle meshes which involves testing if a point is located inside or outside the given mesh. I have just implemented a basic algo based on raycasting and checking the number of ...
1
vote
1answer
265 views

Covert Minimap render texture to 3d space position

I am using Render texture to make a Mini Map it is working fine but now I want to go further on side map and want world space position from render texture click point. Is there any way available that ...
0
votes
1answer
47 views

How to refer to a object that has just been hit by a ray cast?

I would like to use RigidbodyConstraints.FreezeRotation;in order to freeze the rotation of an object that is picked up. The problem is I don't know how to refer (or call) the currently selected object....
0
votes
2answers
85 views

How to address raycast failures due to tiny holes in a mesh?

Problem: I have a racing circuit that is made out of tiles, each of which is made out of 2 triangles. I need to know over which tile my craft is hovering on; but since there are tiny holes between ...