A rendering technique to create a 3D perspective in a 2D map
Questions tagged [raycasting]
1193 questions
2
votes
3 answers
Basic (fake) raycasting on a 2D heightmap
I'm trying to shade a 2D heightmap using basic raycasting that checks if the ray is intercepted before it should shade it. However it's not working.
Map :
And the raycasting is giving me this:
Red is ray interception, but before intended position…

Maltor
- 553
- 6
- 16
2
votes
1 answer
LibGDX raycast does not collide with Box2D static object
I'm trying to implement a simple AI for a 2D game in libGDX. The AI should make an enemy follow the player if the player is in range and if the enemy can see the player. To determine whether the enemy can see the player I'm using a raycast.
Now my…

Tobias
- 2,547
- 3
- 14
- 29
2
votes
1 answer
Efficient floor/ceiling rendering in Raycaster
I am working on my Raycaster engine for some time, that I am runing on slower machines.
The most challenging problem I occures was/is the efficient floor and ceiling casting.
My question is:
what other faster approached can I use?
(I am not sure how…

Mateusz
- 119
- 10
2
votes
1 answer
Efficient way to create click targets larger that the actual scene object
What’s a good way to have click targets that are larger than the actual scene object?
So far we have been using a larger invisible (yet raycastable) object to do this but it comes at the cost of requiring two draw calls instead of one.
Is there any…

Matthias
- 363
- 3
- 18
2
votes
2 answers
Three.js raycasting when its not full screen
I've been having issues with three.js raycasting recently.
I have a div element for which the element is not the full screen and it should not be the full screen and I think this is causing issues with the positioning of the raycast which I don't…

Hrittik Chatterjee
- 81
- 6
2
votes
1 answer
Instantiated object appears in hierarchy but not on scene
I have a problem with instantiating game object in Unity. So the game is 2D, and this piece of code is for my collider hit. Part of it is in charge of instantiating an object at position where the ray has hit the collider. And it does, when i run…

Juan Don Guterez
- 37
- 5
2
votes
0 answers
Graphic buffer - horizontal and vertical filling, performace
I wonder if it is possible to solve a certain problem.
In short: get optimal performance by filling the buffer not only line by line but also column by column.
Description below:
A graphic buffer is given (i.e. intended to hold a bitmap)
#define…

Mateusz
- 119
- 10
2
votes
1 answer
Unity (C#) - How do I single out GameObject being detected by Raycast in a destroy / respawn system
I'm trying to make a Destroy gameobject, wait x seconds, respawn gameobject system. I have 2 scripts and I'm destorying then instantiating it again. I want to use multiples of the same prefab called "Breakable" but have only the one I'm aiming at…

Ash
- 59
- 7
2
votes
1 answer
Is it ok to render Raycasting using vertex array?
Im making simple fps game using raycasting, because I thought its very fast and light method.
My Raycasting function saves data in to a vertex array, which is then rendered by OpenGl.
But because this array contains vertex for every pixel on the…

Dave F.
- 145
- 6
2
votes
0 answers
Swift ARKit's raycast is returning empty array
I was trying to measure distance of some object from camera. It gave perfect result while using hittest. But, because hittest is now depricated, I was trying to replace hittest function. Following is my code. When I am printing query, it is giving…

Tazwar Utshas
- 921
- 2
- 17
- 30
2
votes
1 answer
Raycast jittering when used to place object in world
I have a script that projects a ray to the ground layer from the mouse to show where an object is about to be placed. Its a city builder thats supposed to show an outline of a house before its placed. The outline is just a prefab with a transparent…

Aaron Winter
- 45
- 5
2
votes
1 answer
THREE.js CSS2D Text Labels - Can they be intersected and identified by RayCasting?
I have been developing a rough diagramming tool using THREE.js and have been using the THREE.js CSS2D facility to make (rotatable and MathJax-friendly) text labels for the diagrams.
I have implemented object picking for ordinary mesh objects (e.g.…

steveOw
- 879
- 12
- 41
2
votes
2 answers
Calculating intersection point of two tangents on one circle?
I tried using a raycasting-style function to do it but can't get any maintainable results. I'm trying to calculate the intersection between two tangents on one circle. This picture should help explain:
I've googled + searched stackoverflow about…

Conros
- 167
- 1
- 3
- 7
2
votes
1 answer
RealityKit and Vision – How to call RayCast API
This question is also asked in the Apple Forum but so far, I have not seen any response there.
The question is really, after finding the point of interested from a frame in ARSession. How to convert that into 3D world coordinate.
How did I got a…

BSharer App - Share Books
- 860
- 10
- 21
2
votes
1 answer
Ray casting with CSG tree
I'm working a project in which I have to perform ray casting and use CSG trees. But I don't know how to use the CSG trees or implement it for this project.
I can do the ray cast and give the final answer. My problem is really how to implement the…

user812926
- 21
- 2