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

learn more… | top users | synonyms (1)

0
votes
0answers
23 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
44 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
69 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
21 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 Start () { coinRigidBody = coin.GetComponent<Rigidbody>(); } void ...
0
votes
0answers
19 views

(Unity C#) Rotating an object over time to a RaycastHit.point vector

I am trying to rotate a game object (a weapon) to point towards where the centre of the player camera is focused. I am raycasting forward from the centre of the camera (centreCast) and also from the ...
0
votes
0answers
43 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
23 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
25 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
44 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
35 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
39 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
35 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
0answers
23 views

Validating object placement on a mountainous terrain

I am creating a game that allows the user to build structures on the terrain. They can choose from a list of structures and place them themselves. My terrain is very bumpy so I am having a lot of ...
0
votes
1answer
22 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
75 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
58 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
113 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
36 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
63 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
41 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
267 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
70 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
52 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
122 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
100 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
86 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
48 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
993 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
72 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
60 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
1answer
58 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-...
1
vote
1answer
58 views

How to Ignore Raycast for Boxcollider2D by layer or boolean?

how can I ignore Raycasting for specific object,perhaps you say use Queries Hit Trigger but when I use it Ignore all Raycasting for triggers but I want filter Ignore Raycasting for some objects I need ...
2
votes
0answers
114 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
106 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
121 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
174 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
40 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
125 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 ...
0
votes
1answer
208 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
41 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
78 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 ...
2
votes
1answer
178 views

Pixel Picking vs Raycasting

I was recently introduced to a way of picking in OpenGL known as pixel picking (or color picking). From my understanding, how this is done is that the scene is rendered to the back buffer with a ...
0
votes
1answer
38 views

Limit Quaternion/vector3 axe in a certain interval

I have some trouble to understand, and handle Quaternion and Vector3. I'm improving the tutorial Tank of Unity: EDIT: Because a video explain so much better, there is a link to the 30 secondes video ...
0
votes
0answers
115 views

Unity 3d sendmessage to another script, with parameter of raycastHit?

I am trying to send message from 1 script to another, and need to do something like that: var hit : RaycastHit; .... if(soemthing){ checker.SendMessage("MakeEffect", hit); } and another script: ...
1
vote
2answers
85 views

Unity3D - Determining if a spherical object is grounded using raycast

I'm making a game revolving around moving a ball around a space. My game has a jump mechanic, so I need to know when I'm grounded in order to determine when I'm able to jump. Best way to check this is ...
0
votes
0answers
34 views

How to convert Non-Axis Aligned Bounding Boxes to AABB

I'm trying to write a raytracer to render boxes (cubes) that are arbitrarily rotated, i.e. not necessarily axis aligned. While I'm reasonably comfortable ray-tracing an axis-aligned cube, I don't know ...
3
votes
2answers
313 views

Need help with a field of view-like collision detector!

I ran into a trouble while making a field of view for my character. I figured how to make it work with a Linecast, but what I really need is a cone-shaped field, so that the character can detect ...
0
votes
2answers
159 views

How can I prevent 2D teleportation from teleporting through solid objects?

In my 2D game, the player is able to teleport to any place on the screen with the click of the mouse button. What I am trying to prevent is the ability to teleport across solid objects. If the point ...