A rendering technique to create a 3D perspective in a 2D map
Questions tagged [raycasting]
1193 questions
0
votes
1 answer
First intersected plane
I am writing a Ray Caster in Java and I have everything working (A can cast the ray and accurately record line-plane intersection). The only thing that I have yet to implement is detecting the first intersection (Not the first tested intersection).…

zfollette
- 475
- 4
- 15
0
votes
1 answer
game collision check when rectangle moves from one position to another if it misses collision in the distance travelled
I know this question is similar to others, but if I have a rectangle bounded game object. Which moves position. How can I check along the line if it intersects with any items in between?
In an extreme scenario. [x = 2, x = 1, width = 1, height =…

perkss
- 1,037
- 1
- 11
- 37
0
votes
1 answer
Three.js: rays & SceneLoader issue
Problem:
Models loaded with SceneLoader() intersects wrong with raycasters.
Simple example:
http://golem.fjfi.cvut.cz/virtual/matusu/GitHub/Git.html
There is a mesh added in program, with which should raycaster intersect (can't find why at the…

TomsaJan
- 27
- 4
0
votes
0 answers
Ray collision fails with THREE.Sprite
I'm using projector and raycaster to intersect a Three.Sprite object, however, I could get the object even if I touch outside of the image bounding. So, I deep into the three.js file, and I found a piece of source:
var intersectObject = function…

Zack
- 1
0
votes
0 answers
Detect mouse pos on terrain
I have a very simple terrain map, 256x256 tiles for example, it's divided into tiles (same squares...). every tile have height, slope...
Something like figure below. My default look will be an iso view. (Each tile can be divied into smaller tiles…

greenpig83
- 13
- 4
0
votes
1 answer
Why isn't this pixel drawer let me change my window size/number of pixels?
I'm trying to build a simple ray tracer and i'm mapping a texture to a quad for visualisation. The resolution i started with is 250X250, but when i change it to, say, 300X300, it compiles and crashes.
#include
#include
using…

whoadrian
- 77
- 1
- 7
0
votes
0 answers
three.js: sceneLoader & rays issue
Issue: Rays doesn't work with models loaded via sceneLoader
Problem explanation: I used to load my model with JSONLoader, but needed to import all information of scene, so I tried sceneLoader(). Everything loads fine, but raycasters…

TomsaJan
- 27
- 4
0
votes
0 answers
Ray Casting AS3
I decided I want to learn about ray casting and give it a go. Although I am by no means a good programmer I just thought it would be good to try to expand my knowledge, plus this may be useful at some point :P I have been trying to follow this…

FishBowl
- 9
- 4
0
votes
1 answer
How to find the relative location of a 3d point on a surface transformed in 3d space
I have a math/vector/matrix question that I can't seem to work out.
I have 4 points in 3D space that represent the bounds of a surface.
I have written a raycast algoritum to get the intersection location of the mouse "ray" against the rectangle in…

Daniel Armstrong
- 829
- 9
- 22
0
votes
2 answers
Light/Ray casting in java?
I've been trying to make a dynamic light system in java, without using libraries. For some reason, though, it seems I can't get light to run efficiently. It flickers and lags a ton. I'm doing this with no previous understanding of lighting…

Blake Doeren
- 665
- 4
- 10
- 16
0
votes
1 answer
Three.js: Raycast intersection on Line with BufferGeometry
Since R59 raycasting on lines is possible and it works perfect. I'm displaying a tooltip on mouseover.
Because of growing data, I had performance issues, so I decided to switch from THREE.Geometry to THREE.BufferGeometry. Everything works fine…

PanChan
- 372
- 1
- 6
- 18
0
votes
1 answer
Raycasting against 'subscenes' in three.js
So I am working with the webgl_interactive_cubes.html in the three.js examples, and I have a relatively simple question: Is it possible to test for intersection of a ray with the children of an object.
for example, if I do something like:
for ( var…

Cabbibo
- 1,371
- 3
- 17
- 30
0
votes
1 answer
Raycasting direction relative to global coordinate system , not local
I have used raycasting method to detect different colored strips on either side of the track and keeping my car object in position by calculating the distance. But the problem is the ray always points in the constant direction in the global…

dev_shaguar
- 53
- 5
0
votes
1 answer
Can't cast a ray from the camera down to objects based on mouse position
I have a camera looking down on my game world. I want to allow the user to click on objects. The following script is attached to the MainCamera.
void Update () {
if (holdingSomething)
{
if (Input.GetMouseButtonUp(0))
{
…

Michael
- 455
- 7
- 18
0
votes
2 answers
Modifying an AI script with raycasting in Unity
So I've managed to modify some code that I have found for ray casting so that my enemy moves towards the co-ordinates of my first person camera. However, I need to change the way the ray casting moves the enemy around the obstacles in my scene. I'm…

TJBaldy
- 23
- 1
- 2
- 6