Questions tagged [raycasting]
A technique for using rays to determine points of intersection. Often used in lighting simulation.
457 questions
0
votes
0
answers
59
views
How to Implement Ray Casting and Aim Assist Scaling in UE5 Using C++ for FPS Mechanics?
I'm developing an FPS shooter in Unreal Engine 5 and currently working on the aiming mechanics for keyboard and mouse (KBM). I want to implement an aim assist system that uses ray casting to detect ...
0
votes
2
answers
117
views
How to make a raycaster render complex scenes?
I have written a simple raycaster in C++ which can render wall based scenes like 3d mazes. On YouTube I saw a video showcasing 3D games made in Scratch. One of the games were a 3d racing game where ...
0
votes
0
answers
37
views
How to use sensors and ray casting for collision detection in Pygame (using a custom Mask/sensor class)?
I am making a Sonic game in Pygame and I have recently gotten my hands on a Python class that uses pygame.rect and pygame.mask in unison to create sensors that can be used to accurately detect the ...
0
votes
0
answers
83
views
Raycast DDA: Wall rendering and floor rendering out of sync
I come for theory help with a classic raycast algorithm (currently, based on DDA). The problem is not with the algorithm itself, but with the floor rendering code.
I left the code of my raycast render ...
1
vote
1
answer
108
views
Why is my raycast not working?
I'm trying to ray-cast mouse clicks to the surface of a sphere (from which point, I'm going to get the coordinates of the vertex of the sphere's mesh that are closest to the click). The following ...
0
votes
0
answers
68
views
Issue raycasting when direction vector nears zero in x and z axis
I am working on a voxel game right now in OpenGL and working on implementing raycasting so I can pick blocks in my world. So far what I have created works quite well except for when the x or z axis ...
0
votes
1
answer
56
views
How to filter/ignore child objects from an ML Agents RayPerceptionSensor in 3D?
I am making a snake AI with Unity ML Agents. There will be lots of snakes who will eat and dodge each other.
A 3D RayPerceptionSensor detects everything, but there is a specific case where a problem ...
0
votes
1
answer
139
views
BSP Tree Troubles and Unpredictable Results
I've been trying to fix this problem myself for ages, but I really do need help. I'm creating a BSP tree for my 3D game (baked in the map files, quake style) to replace my existing naïve collision &...
0
votes
1
answer
296
views
Mouse Ray Picking: Z-Coordinate of Projected vector (glm::unproject)
I've run into a curious issue when implementing ray picking in my game engine.
It seems the Z coordinate of the Projected matrix has to be ever so slightly more than ...
0
votes
1
answer
90
views
Finding the index in a material where a raycast hit
I have a gameobject with a mesh collider. The mesh is simply a flat plane.
I raycast to the mesh and I'd like to get the index on the material's basemap where I got a hit.
I assumed ...
0
votes
0
answers
109
views
How to align to 2D ground surface directly underneath?
I'm out of ideas at this point.
I'm trying to set up a function inside my player controller that aligns the player with whatever is under it (usually the ground), ive tried using Raycasts, collisions ...
0
votes
0
answers
41
views
Ray-Sphere Intersection Always States Ray Origin Is Point Nearest Sphere Center
I am writing a simple graphics engine using Rusts WGPU. I have a Sphere rendering at the origin of my scene like so:
...
0
votes
0
answers
87
views
Red raycast despite valid target in Unity VR
I have a question regarding Unity VR and Interaction Toolkit.
When I point at a UI canvas element, the raycast turns from red to white (indicating that it is a valid target). However, when I create a ...
1
vote
1
answer
77
views
How to detect colored pixel of Sprite3D texture with perspective camera ray?
I've tried to ray cast my mouse position to Sprite3D on screen but I have some problems with it.
...
0
votes
2
answers
131
views
Detecting collisions with trajectories
What if an object were to have collision detection implemented as so: A ray in the direction the object is moving in, and a ray in the direction of gravity.