Questions tagged [raycasting]

A rendering technique to create a 3D perspective in a 2D map

1193 questions
3
votes
1 answer

three.js javascript/raycasting code not compatible with retina display macs

Does anyone have an explanation as to why the interactive cubes below do not work on retina display macs? http://mrdoob.github.io/three.js/examples/canvas_interactive_cubes.html The code works in Firefox, Safari and Chrome in the non retina macbook,…
3
votes
1 answer

threejs raycasting - intersections between camera and a loaded obj model

I'm moving a camera through a scene that contains an obj I've loaded as a mesh, and I want to detect if the camera has collided with any of the walls of my obj. I've based my code off this threejs example:…
mheavers
  • 29,530
  • 58
  • 194
  • 315
3
votes
0 answers

Three js Raycasting intercepting particles with attenuated sizes

I'm trying to use a Raycaster to intercept particles in a PointCloud object. The point cloud is being created as such: ... other initializations, like the scene object... var geometry = new THREE.Geometry(); var sprite =…
3
votes
1 answer

Ray tracing: Bresenham's vs Siddon's algorithm

I'm developping a tool for radiotherapy inverse planning based in a pencil-beam approach. An important step in these methods (particularly in dose calculation) is a ray-tracing from many sources and one of the most used algorithms is Siddon's one…
3
votes
1 answer

three.js orthographic camera object picking

i am trying to pick objects in a scene where i use an orthographic camera. my code fragment already works, but it is not precise. i already found some answers on stackoverflow, but those are deprecated or won't work anymore at all. here is my code…
kampfgnu
  • 107
  • 3
  • 10
3
votes
1 answer

How Unity Raycast Detect the point "Out" of collider, not only just "In"

By using Physics.Raycast in Unity, we can get hit information easily with the point, normal, collider name... But how can I get the "point" where ray go out of the collider? Many thanks for your time thinking about this problem.
user3792343
  • 31
  • 1
  • 2
3
votes
1 answer

Check if ray hit cube

Is there a very fast way to check if a ray hit a cube? I know that i could just simply check every triangle of the cube, but there are a lot of rays and a lot of cubes, and it has to happen very fast. So is there a simple and fast way to check if a…
3
votes
0 answers

3D Infinite Cone line intersection formula

EDIT: Would be awesome if someone could explain in a comment what really goes on. We basically found out the answer by coincidences. I'm trying to do line tests against an infinitely large cone, but I'm having trouble understanding what I'm doing…
NangiDev
  • 55
  • 6
3
votes
2 answers

Casting a ray from mouse through distortion matrix

I've searched the board, as well as the oculus board, and unity board. Couldn't really find something that helped. I'm working on a vehicle simulation. Before we started using the oculus, it was just a regular first person perspective. You used a…
gord0
  • 111
  • 5
3
votes
2 answers

Setting up ray (origin, direction) and triangle intersection(without glm)

Edit3 : My problems were in completely different functions than i expected. ill let the code stay, maybe this helps someone :) (and dont forget to debug!). Im trying to find the vector where a line intersects with a triangle. Current state: Random…
Raphael Mayer
  • 667
  • 6
  • 19
3
votes
3 answers

Computing the gradient in volume ray casting

Please help me clear up this question I have about the volume ray casting algorithm: In the wikipedia article (link), it says that "For each sampling point, a gradient of illumination values is computed. These represent the orientation of local…
Imre Kerr
  • 2,388
  • 14
  • 34
3
votes
2 answers

SFML Drawing Pixel Array

I found this (http://lodev.org/cgtutor/raycasting.html) tutorial on the Internet and was interested and wanted to make my own. I wanted to do it in SFML though, and I wanted to extend it, and make a 3D version, so there could be different levels the…
user2779815
  • 31
  • 1
  • 1
  • 2
3
votes
1 answer

Three.js raycast produces empty intersects array

I'm trying to detect when the user has clicked on a specific cube in my 3d scene I've seen a few similar questions but none seem to have quite the same problem as me. I have a 3D Array of cubes which populates and displays fine but when my mouse…
kevatron400
  • 65
  • 1
  • 6
2
votes
1 answer

Is stochastic raytracing inherently cache-unfriendly?

Specifically in the context of a real-time raytracer where view updates are frequent? The obvious answer would seem to be "yes" and yet I wonder if any methods have been found to accelerate Monte Carlo methods given their usefulness.
Engineer
  • 8,529
  • 7
  • 65
  • 105
2
votes
1 answer

How is ray coherence used to improve raytracing speed while still looking realistic?

I'm considering exploiting ray coherence in my software per-pixel realtime raycaster. AFAICT, using a uniform grid, if I assign ray coherence to patches of say 4x4 pixels (where at present I have one raycast per pixel), given 16 parallel rays with…
Engineer
  • 8,529
  • 7
  • 65
  • 105