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

learn more… | top users | synonyms (1)

0
votes
0answers
48 views

Find which object is clicked on 3d scene

I am using GamePlay3D engine. I have on scene a couple of 3d objects and I want to make them clickable. How to find when I click which Node/Object contains given projection point? I tried with code ...
1
vote
1answer
40 views

Raycast a ray to the tip of another ray

I'm using unity to raycast a line from the center of my camera viewport to a world position (yellow line). I also want to cast a ray from the center of my character to this same point (blue line). I ...
0
votes
0answers
25 views

Drawing Ray from ray picking is not working correctly

I have been implementing ray picking to select squares in my opengl program. I tried to follow this post I found http://gamedev.stackexchange.com/questions/109579/algorithm-for-triangle-picking after ...
1
vote
0answers
26 views

How to generate mesh at runtime using raycast points?

I'm trying to make a clone of the trail/line renderer with the difference that everything is perfectly flat, i.e. the faces are not designed to face the camera. I'm using two raycasts to get the ...
0
votes
1answer
55 views

2d raycast collision problem

I am currently making a 2d top down game in unity and have stumbled upon a problem with my raycast collision. I want my green player to stop moving when colliding with a wall, therefore i made my ...
0
votes
1answer
66 views

Raycasting. Corner trap

In my top-down game character moves to target (pathfinding) also avoiding obstacles with Raycasting(Central ray with whiskers), but situation like on picture causes shiver and unneeded turning ...
0
votes
1answer
42 views

How to find a material through a raycast in Unity 5?

I have an empty object with a script on it and I want to be able to move the empty over other objects and then have it print out the name of the material for the triangle that it's hovering above. ...
0
votes
0answers
17 views

Finding intersection in CPU ray casting

I'm trying to implement a ray casting on CPU, for each pixel I have a ray. I'm reading the data which is stored in a rectilinear grid. I'm trying to find the intersection but I'm not sure how to do ...
0
votes
0answers
41 views

Simulate a touch on a point where ray hits in Unity

I want to simulate a touch input on the position where a ray hits an object, and only if it hits something. I know that it's not common to do it with a raycast, but I need it this way for the HTC ...
0
votes
0answers
22 views

Raise an object off from the surface of another object set by raycasts

I have a basic FPS and I just added in bullet holes. The way it works is when the mouse is clicked, a method is called in the animator that fires a raycast from the nozzle of the gun outwards, and ...
1
vote
0answers
75 views

OpenGL RayCasting and Intersection with plane

I have been trying for a couple of days to raycast. I have a Renderable/Texture/Primitive/Whatever placed in the WORLD at 0.0f,0.0f,0.0f, and when I click the mouse I want to know at what X,Y ...
1
vote
2answers
53 views

Wall checking not working correctly

Basically I am working on side scrolling 2d game. For that I want to check whether player is collided with wall. I have written some code for it but can't able to decide where I have done stupid ...
2
votes
2answers
93 views

How do you avoid lag with Three.js and mousemove?

I'm trying to create a browser moba-like game using three.js. I'm using WASD for movement and the player rotation follows the mouse with mousemove then lookAt() the intersection. The problem: As I ...
2
votes
0answers
31 views

Combining Two Sets of JavaScript

So I am fairly new to programming and I am trying to learn by making a simple game. I watched to different videos on ray cast shooting and one of them has code for bullet hole decals that I wanted to ...
2
votes
1answer
39 views

Find out hit child with RaycastHit

Let's assume having a (2d-) gameobject with 3 images: Head, body, feet. By using RaycastHit2D I can find out if the gameobject was hit (for example by the mouse): RaycastHit2D newSelectedObject = ...
1
vote
1answer
123 views

Raymarching on a Hi-Z buffer in GLSL

So I'm trying to implement Screen Space Reflections using a Hierarchical z-Buffer in GLSL. I'm following the approach from GPU Gems 5 and the Frostbite presentation linked here ("Stochastic ...
4
votes
3answers
129 views

How to test for adjacency?

I need to come up with a better way to test for adjacency in a grid environment. Imagine that the blue is water, the green is land, and the red dot is a character. What I need to do is efficiently ...
1
vote
0answers
57 views

How to make dynamic DOF from mouse position in Unity 5?

I found a video a while ago for how to make a dynamic DOF in unity. It fires rays from the camera and positions an empty at the location that the ray first hit. How can I change this so that it ...
1
vote
1answer
51 views

2DRaycast is shooting slightly in wrong directions

I wanted just a simple 2DRaycast, which points from my character to my mousePointer. So I found the following code in the Internet, most people seem to use it like that. So I tried it, but it isn't ...
1
vote
1answer
96 views

Why is Raycast hitting masked layer?

Many questions have been posted on this topic but I'm facing a weird behavior which I could not find an explaination for. I perform a raycast giving it a LayerMask parameter which is defined as ...
1
vote
1answer
111 views

Ray & Segment Intersection

I'm writing some code to check intersection between all of a rectangles segments and a ray. It will sometimes use the Left and Right side of the rectangle as the closest face hit (face DA & BC) ...
1
vote
3answers
205 views

Unity C# - Raycasts, How to Ignore Triggers?

Let's say I have a Raycast, but I don't want it to collide with any triggers. I don't want to change the Project settings since that's a little inflexible. How can I have a Raycast ignore any ...
0
votes
0answers
75 views

Use xbox right analogue stick for ScreenPointToRay

I have done a tutorial where the player rotation is controlled with raycasting which follows the mouse pointer. I have been trying to change it to follow the right analogue stick on a xbox controller. ...
2
votes
1answer
99 views

Continuous Collision Detection

So I'm playing around with the separating axis theorem and collision. Obviously the problem of what face it collided with arose. I need the unit normal which is tangent to that face it collided with ...
1
vote
2answers
207 views

Unity - Raycast not hitting to BoxCollider2D objects

I'm working on 2D and I have a Quad as background. And some wall sprites over this quad : I'm instantiating wall prefab sprites over quad when user click to somewhere. But I don't want to ...
0
votes
1answer
193 views

Click to move - get NavMesh layer

I'm using NavMesh, and NavMeshAgent for my character movement and Pathfinding. I made a testing NavMesh with 2 area layers: 0 = Walkable 3 = Water. In have a click to move script, and i need to ...
0
votes
1answer
14 views

characterController reference issue

I am trying to move my character to point that taken from mouse position. here is my code: private Vector3 hittedPoint=Vector3.zero; if (Input.GetMouseButtonDown (0)) { Ray ray = ...
0
votes
1answer
72 views

Getting ray using gluUnProject or inverted MVP matrix

I've read a lot of topics here, on SO, opengl.org etc. Example how gluUnProject should work (from NeHe tutorial): winX = (float)x; winY = (float)viewport[3] - (float)y; glReadPixels( x, int(winY), 1, ...
1
vote
2answers
59 views

Cursor position to a 3D ray using angles

I've been stuck for a month trying to get gluUnProject working. After my attempts to use gluUnProject failed (as well as attempts to implement gluUnProject functionality manually) I implemented method ...
1
vote
1answer
43 views

Shading a 2D visibility mesh to act like a light?

I have a visibility mesh made by raycasting: https://my.mixtape.moe/omjlgr.webm Right now, I'm using a shader to color the mesh white and fall off with distance and radius (the texCoord in this case ...
1
vote
1answer
219 views

Is it possible in Unity to Flip a 2D Sprite Without Flipping the Object it is Assigned to?

I 'built' (followed a tutorial) on a collision detection system, and when I flip the object to go left and right the collision messes up. So I have three options; find a way to modify the collision ...
-1
votes
1answer
42 views

Simple voxel-block melee removing script

I'm trying to create a voxel based game, now I want my character to remove blocks with a melee weapon, but I'm not sure which way to go. I mean is it the only way to get the Block with a raycast? I ...
0
votes
2answers
167 views

Raypicking / raytracing in OpenGL

Alright, so before you down vote saying that OpenGL doesn't support rays for rendering, please read: So I want to detect a quad in opengl 1.1( I don't want to use opengl 3.0). I wanted to detect it ...
0
votes
0answers
48 views

Unreal engine: How to get FHitResult.FaceIndex?

When I do PlayerController->GetHitResultUnderCursor(ECollisionChannel::ECC_WorldDynamic, false, TraceResult); TraceResult.FaceIndex is always -1. Here @OriCohen says that I have to "use a ...
1
vote
0answers
108 views

Unreal Engine 4 Line Trace Error

This is the error that I am currently facing: PlayerPawn.cpp.obj : error LNK2019: unresolved external symbol "public: bool __cdecl APlayerPawn::Trace(struct FHitResult,class AActor *,struct FVector ...
2
votes
3answers
103 views

Unity - Check if object is facing Vector3 coordinates

I am having a hard time figuring this out, I want to have objects that move around randomly, and when they get new coordinates to move towards, face them, and then move. Here's explained: Target ...
0
votes
0answers
18 views

Problem with cameracliping unity

Hello GameDev Community, i've got a small problem with figuring out a way to do cameracliping in the unityengine with raycasting i got two main problems the first being that my camera flicks ...
1
vote
1answer
43 views

Collision resolution moving Point to AABB with raycasting

This is probably trivial, but I'm having trouble making it work. I have a 3-coordinate world of particles simulated with Verlet Velocity. I only care for collision between their centers and a few ...
0
votes
0answers
129 views

How do you set up the physics for a tank?

My goal is to make some tank like vehicle since there is not a suitable one in unity5 store yet. First I tried wheel collider, could not get it to work. I tried to use raycasting and fixed joint, ...
1
vote
1answer
66 views

How can I determine “exact moment” of collision with ray casting?

I'm currently brainstorming how the physics for my game engine is going to be handled. It's top down and I'm thinking of using ray casting for collision detection. I've reached two potential problems ...
1
vote
1answer
68 views

How to resolve collisions when using ray-casting to predict the location of future collisions?

I ran into a question I can't seem to solve, while implementing the movement/ collision checking code for my game. The game is in 2D and all objects in my game use either AABBs or circles as collision ...
0
votes
1answer
182 views

OpenTK Ray Picking

I just can't get ray picking to work (I need to drop old working faedback mode, and replace it with color pick, but because my scene can have up to 300K+ objects it is reasonable to filter (it's a ...
1
vote
0answers
89 views

Issues with 2D raycasting lighting under limitations of HLSL 3.0 pixel shader

I've been writing my own HLSL pixel shader for dynamic lighting using raycasting. Unfortunately, since I'm using this out of XNA, I can only use up to ps_3_0. As you can see, the limitations ...
2
votes
1answer
155 views

How to Reciprocally draw on a 3D mesh and 2D UI Image in Unity?

My question is a bit involved so I'm going to split it into parts and attach a picture. 1) In Unity I'd like to be able to draw a line on a 3D worldspace mesh with the mouse. 2) As I'm drawing on ...
0
votes
1answer
83 views

Would Raycast suffice for a game clock based on sun position?

I need help with some logic in my script. I created a dynamic day/night cycle that works fine in itself, but I want to add a game clock that works off the initial position of the sun (Directional ...
1
vote
1answer
179 views

Raycast, UI and Update Question

I have movable objects in a scene. When Raycast hits an object, I have a hovering UI that moves to a retaliative distance from the hit object. When the object is dragged, the UI's position is moved ...
4
votes
2answers
181 views

Best way of writing pixel manipuliting-intensive applications with OpenGL/Direct3D

Recently I have been making little experiments with engines similar to old Wolfenstein 3D, Doom and Build, engines where the 3D rendering is entirely done in software and therefore you need full ...
1
vote
0answers
71 views

Can I render 3D objects in Ray Casting engines?

I was gathering some information on the glorious Ray Casting technique. As far as I've understood it's not a complete 3D rendering, and that's why objects and NPC's are often displayed as simple ...
2
votes
1answer
659 views

Is Physics2D.BoxCast a safe alternative to a row of raycasting?

Raycasting in rows is a common practice. Is using the Physics 2D BoxCast function a good alternative to using multiple raycasts spread out (an example use being collision detection in a custom ...
0
votes
1answer
133 views

How would I check the range against the entirety of an enemy object, and not just it's transform.position?

I want to be able to do range checks against the entirety of an enemy object, and not just it's transform.position. The enemy object can have it's side or nose within range, but range detection will ...