A rendering technique to create a 3D perspective in a 2D map
Questions tagged [raycasting]
1193 questions
2
votes
1 answer
Three.js raycasting doesn't work on a moving object
This is a three.js and typescript project. I am trying to color a sphere by raycasting to it, but it seems like the raycast doesn't know when the object has moved and assumes it still is at it's original position and it doesn't hit the object when…

Dronius
- 25
- 6
2
votes
1 answer
World coordinates wrong when Raycasting and Rasterizing in the same scene
I am rendering two cubes, both side length 1, centered at the origin (min coords. [-.5, -.5, -.5], max coords. [.5, .5, .5]), one with rasterization (vertices set by vertex shader), another with ray-casting (each pixel casts a ray through a cube).…

Jonny Hyman
- 31
- 4
2
votes
1 answer
Placing an object on the surface of a rotated Sphere
this is my first post so I will try my best to explain. Every time I place an object on a rotating spheres surface, it gets offset the more the sphere rotates.
I tried offsetting it back to the mouse, but it didn't work. I'm at a loss for what to…

Rokborr
- 33
- 8
2
votes
1 answer
Unity how to affect variable from other classes with raycast. By using scripting and visual scripting bolt
I need to blind an enemy ai with the use of raycast.
When the raycast collides with the enemy, the boolean of the enemy isblinded must be set to true.
I have refrenced the enemy gameobject, but the console log gives me this…

logi
- 33
- 3
2
votes
1 answer
How to get Raycaster to correctly detect intersection of meshes in react-three-fiber?
Three.js and React three fiber newbie here. I'm attempting to get ray casting to work correctly using Raycaster from three. I’ve got 2 simple mesh boxes, one static and other movable via keyboard events. Goal is to console log the static mesh when…

Sandeep Chandran
- 21
- 2
2
votes
1 answer
How Can I Make A Ray Cast From The Bottom of My Player
I'm a beginner game developer and I'm making a top down 2D game. The player's collider is on the bottom half of his body, kind of like Stardew Valley. In order to detect when the player hits a tree, I cast a ray from the player to the mouse. The…

Business Cactus
- 35
- 6
2
votes
1 answer
THREE.js Raycasting Points
I'm trying to implement raycasting for the Points object.
The problem is that the raycaster selection doesn't match the pointer position.
I took as reference these 2 examples from…

Simone Tasca
- 23
- 3
2
votes
1 answer
Floorcasting not scrolling in raycasting engine?
I'm currently working on a raycaster in Java, and so far, I have the floor correctly textured. The problem, however, is that the floor doesn't scroll. In other words, when I move the camera in the projection, the floor stays the same, yet the walls…

Joshua Crotts
- 69
- 1
- 8
2
votes
1 answer
Is there an event for when a raycast hits an object?
Is there an event for when a Raycast collides with an object? I've been looking all over the internet for it, but there's just no results. Please help!

neksodebe
- 65
- 8
2
votes
2 answers
Unity RaycastHit2D with something specific
I have a laser. its goes on forever. But when the laser touches ANYTHING like (wall, player, box, trigger colliders, etc...) it stops there. So it basically doesnt go through colliders.
But I dont want that. I want the laser to ONLY stop if the…

tok23
- 29
- 5
2
votes
1 answer
ThreeJs Badly sees the coordination of the mouse through the canvas
Structure of my project 66% threejs model, 44% html (side control) using Bootstrap.
I’m trying to make mouse picker, when pointing at an object so that it is shown on which object it is pointed. As I understand it, he sees the coordination of the…

Arthur
- 385
- 3
- 13
2
votes
1 answer
OnPointerEnter and OnPointerExit not being triggered Unity
Alright so basically the issue that I've been having is that for some reason a GameObject is interfering with the OnPointerEnter function. I'm pretty sure that OnPointerEnter detects only UI. So that's why I'm extremely confused when seeing that a…

user12791203
- 41
- 1
- 5
2
votes
1 answer
Why my raycasting keeps going through walls?
here's my code, ignore unused stuff and its overal messiness
import sys, pygame, time, math
pygame.init()
size = width, height = 640, 640
black = 0, 0, 0
screen = pygame.display.set_mode(size)
ball = pygame.image.load("ball.png")
map =…

felipebubu
- 131
- 7
2
votes
2 answers
CPU Ray Casting
I'm attempting ray casting an octree on the CPU (I know the GPU is better, but I'm unable to get that working at this time, I believe my octree texture is created incorrectly).
I understand what needs to be done, and so far I cast a ray for each…

Benzino
- 577
- 2
- 8
- 21
2
votes
1 answer
Translating a y-shearing horizon offset to a pitch angle in a raycaster
I am writing a first-person shooter, using raycasting to render the world. I have added y-shearing successfully, so that I can look up and down (albeit with a bit of warping, as expected). If my y-pitch value is zero, the horizon line (indicated by…

Caspian Ahlberg
- 934
- 10
- 19