A technique for using rays to determine points of intersection. Often used in lighting simulation.

learn more… | top users | synonyms (1)

1
vote
2answers
412 views

What mathematics would I need to know in order to build a 2.5D raycasting engine

I realize this is a fairly common-type question, but I've been studying Maths in my spare time, fairly slowly at that, and I really want to develop a raycasting engine like the original DOOM. I know ...
4
votes
1answer
1k views

Finding if a point is inside of a mesh (Point-in-polyhedron)

How can I find if a point (Vector3) is inside of a mesh? Would this work for both concave and convex objects? I read somewhere that if you raycast in both directions of every axis (X, -X, Y, -Y, Z, ...
0
votes
2answers
627 views

3D collision detection with meshes using only raycasting?

I'm building a game using WebGL and Three.js, and so far I have a terrain with a guy walking on it. I simply cast a ray downwards to know the terrain height. How can I do this for other 3D objects, ...
3
votes
1answer
323 views

3d Picking under reticle

i'm currently trying to work out some 3d picking code that I started years ago, but then lost interested the assignment was completed (this part wasn't actually part of the assignment). I am not ...
1
vote
1answer
310 views

How to calculate the viewing cone radius at a distance in raymarching?

I'm "raymarching distance fields" (proper lingo: sphere-tracing) in GLSL. To implement cone-marching atop of it (and also to minimize the number of raymarching steps regardless of whether ...
1
vote
1answer
1k views

Optimized algorithm for line-sphere intersection in GLSL

Well, hello then! I need to find intersection between line and sphere in GLSL. Right now my solution is based on Paul Bourke's page and was ported to GLSL this way: // The line passes through p1 and ...
11
votes
1answer
961 views

How can I draw an arrow at the edge of the screen pointing to an object that is off screen?

I am wishing to do what is described in this topic: http://www.allegro.cc/forums/print-thread/283220 I have attempted a variety of the methods mentioned here. First I tried to use the method ...
0
votes
1answer
4k views

OpenGL ES 2.0 gluUnProject

I've spent more time than I should trying to get my ray picking program working. I'm pretty convinced my math is solid with respect to line plane intersection, but I believe the problem lies with the ...
7
votes
1answer
631 views

Skewed: a rotating camera in a simple CPU-based voxel raycaster/raytracer

TL;DR — in my first simple software voxel raycaster, I cannot get camera rotations to work, seemingly correct matrices notwithstanding. The result is skewed: like a flat rendering, correctly rotated, ...
3
votes
4answers
158 views

Ray Triangle Intersection issue

I'm trying to perform ray triangle intersection on a mesh made of triangles. The below code seems to work fine but only about 50% of the time. The ray often gets into positions where no intersection ...
5
votes
1answer
400 views

Raymarching artifacts

I was playing with raymarching using distance fields in GLSL sandbox and got stuck with a strange problem with artifacts. Click here and take a look at the spheres generated in corners, they have ...
3
votes
1answer
410 views

How to calculate FOV with four-walled tiles?

I'm working on a 2D tile-based game. I'm trying to calculate FOV and I've implemented walls so they don't take up an entire tile. Instead, they just take up a side of each tile. Similar to: class ...
1
vote
1answer
2k views

Picking objects with mouse ray

I simply want to pick a few spheres in my scene using the mouse-ray. I have implemented(copied most of it but with little understanding) a ray-sphere collision code. Also I have implemented the code ...
13
votes
2answers
5k views

How can I implement lighting in a voxel engine?

I am creating the MC like terrain engine, and I have thought that lighting would make it look a whole lot nicer.The problem is that the blocks are not being lit properly when a block which emits light ...
1
vote
1answer
259 views

XNA - Incorrect Mouse Ray?

I have the following code: Vector3 nearSource = new Vector3(mState.X, mState.Y, 0.0f); Vector3 farSource = new Vector3(mState.X, mState.Y, 3.0f); Vector3 nearPoint = ...
5
votes
2answers
342 views

How does this snippet of code create a ray direction vector?

In the Minecraft source code, this code is used to create a direction vector for a ray from pitch and yaw:' float f1 = MathHelper.cos(-rotationYaw * 0.01745329F - 3.141593F); float f3 = ...
6
votes
1answer
561 views

Finding which tiles are intersected by a line, without looping through all of them or skipping any

I've been staring at this problem for a few days now. I rigged up this graphic to help me visualise the issue: http://i.stack.imgur.com/HxyP9.png (from the graph, we know that the line intersects ...
0
votes
2answers
607 views

What graphics library should I use for line rendering for a raycasting renderer?

I want to develop simple RPG with ray casting rendering. I chose SDL for graphics and input. The problem is there is no native line drawing in it, which I need to start prototyping a ray casting ...
5
votes
2answers
671 views

What are the time-efficiency characteristics of these voxel data structures?

Real-time, high-resolution voxel raycasters tend to use one of the following optimising data structures in order to achieve interactive frame rates. What are the pros and cons to these, and what other ...
4
votes
1answer
325 views

Where can I find a BRDF reference implementation?

Does anyone have a link to a sample implementation of how to create/handle 4D BRDFs? I found a few interesting papers and websites, Szymon's (student, Princeton) BRDF survey, 1997 SIGGRAPH survey ...
4
votes
1answer
647 views

Raycasting problem

I have a problem with my raycasting. I have 8 cubes, that define the first level of an octree (Eg. they create bigger cube). I need to raycast them and "render" each cube. If I have only one cube, ...
3
votes
2answers
2k views

Raycasting in Unity3D?

I have a game object on screen represented by a cube (but say it was a quad or something else all the same). How do I raycast to check intersections? Keeping in mind I may not be raycasting fora ...
0
votes
1answer
755 views

How to not-unroll loops in Shader Model 3 HLSL

I'm working on raycaster in HLSL, unfortunately it have to be in DX9. But it cannot be compiled I did similar raycaster in DX11 and i know that there is always problem with FXC compiler that it tries ...
2
votes
1answer
790 views

How can I exclude some rigid body from rayTest in Bullet Physics?

I'm trying to picking some object with rayTest method of BulletPhysics. The problem is my stage is surrounded with walls (btStaticPlane) and the target objects (btSphereShape) are in there. And I'm ...
4
votes
1answer
373 views

Direction vector in raycasting

When I read about how to get the direction vector in raycasting, for example on this site: http://www.daimi.au.dk/~trier/?page_id=98 They first render the mesh with front face culling and then with ...
3
votes
1answer
393 views

Hashing 3D position into 2D position

I am doing volumetric raycasting and curently working on depth jitter. I have 3D position on ray and want to sample 2D noise texture to jitter the depth. Function for converting (or hashing) 3D ...
3
votes
1answer
941 views

Ray-plane intersection to find the Z of the intersecting point

I have a rectangle in 3d space (p1, p2, p3, p4) and when the mouse rolls over it I need to calculate the exact Z of the point on the rect, given the mouse coordinates (x, y). Would a Ray-plane ...
3
votes
1answer
5k views

3D Ray Casting / Picking

I am not sure if I should post this link, but I feel this falls into game development just as much as it does math. I have a ray cast's far and near values and I am trying to calculate the end point ...
3
votes
3answers
954 views

How to determine what triangle in a mesh the cursor is pointing to?

I have a game I'm working on in which items are "placed" and "selected". In order to do this, I need to determine what triangle in a mesh the cursor is pointing to. I have no trouble with getting ...
3
votes
2answers
335 views

What are the technologies that makes physics engines so good for raycasting?

again. This question is strictly related to this one so, what is the technology that makes physics engines suitable for raycasting? It is a particular data structure? Has it to do with the engine's ...
4
votes
3answers
3k views

Why do we use physics engines for collision testing or raycasting?

There is a thing I don't understand about game engines: why it is so common to use physics engines to do raycasting or collision testing? Say that you have a 3D scene loaded in your scene manager ...