# Tagged Questions

The point or points at which two or more shapes cross or overlap one another.

727 views

### How do I write a shader that lights up when objects are near a surface?

In this Overwatch gameplay video, the character's shield lights up white in areas that are near other objects' geometry. Note the white edges on the blue shield, near the floor, walls and pillar. ...
2k views

### How to determine which cells in a grid intersect with a given triangle?

I'm currently writing a 2D AI simulation, but I'm not completely certain how to check whether the position of an agent is within the field of view of another. Currently, my world partitioning is ...
565 views

### How do I find the closest points(thereby forming a polygon) enclosing a particular point?(see image)

I am working with a game engine, and my task is to add code for simulating fracture of rigid meshes. Right now I'm only working on breaking a cube. I am using Voronoi's algorithm to make a (...
8k views

### How do I find the intersections between colliding circles?

I want to find whether 2 circles with radii r1 and r2 intersect, and if so, where they do so. Is there a simple solution?
1k views

### Ellipsoid v. Box collision detection

I'm trying to write some collision detection code. ATM i have the code properly resolving Ellipsoid v. Ellipsoid collisions, and Box v. Box collisions, but Ellipsoid v. Box collisions doesnt work. ...
114 views

### How to find out the vertices of the polyhedron formed by the overlapping area of two rotated boxes?

What is the most efficient way for finding out the vertices of the polyhedron formed by the overlapping area of two rotated 3D boxes? If it is still confusing what I mean by "polyhedron formed by...",...
1k views

### Closest point on an ellipsoid

I need to know how to get the closest point on the surface of an ellipsoid to another point. I had an idea, but apparently i was wrong, and oversimplfying. What i did was squash the ellipsoid and ...
6k views

### Triangle - Rectangle Intersection in 2D

I had previously asked this for 3D but now I changed my strategy and would like to do the intersection in 2D. The Rectangle is axis aligned and will always be in a fixed position, and has a constant ...
3k views

### How to Calculate the Contact Point between Ray and Plane

Is there any quick way to find the intersection point between Plane and Ray?
2k views

### Fast method of detecting whether point is inside mesh

I'm trying to construct a 3d object from a large number of particles. I think this is called BVH (Bounding volume hierarchy). I figured the best way is to draw the particles inside the mesh, then let ...
3k views

### Triangle-Plane intersection in 3D space

I would like to clip a triangle if its bounds lie partially out of a cube for this I guess I would need some kind of Triangle Plane intersection code, I'm not well versed with math but I do have the ...
251 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 ...
137 views

### Detecting if a point is inside a rectangle

I have a mouse cordinates in 2D game (x and y) and a rectangle (x,y, width,height). How to find if the point is in the rectangle? I do not have any code to post here. I'm just searching for help.
139 views

### Intersection of a Line and a Rectangle

I have to calculate the intersection of a line segment (represented by 2 points) with a rectangle. For example: Axis aligned rectangle corners: (0, 0) (100, 100) Point 1: (50, 50) Point 2: (50, ...
273 views

### How do I test for intersection between a ray and a cone?

I decided that writing a ray-tracer in my game was a brilliant idea, and so now I am looking for code to use for ray to primitive intersection tests. I have based my effort on this very nimble yet ...
543 views

### Explain this line segment intersection code

I've been reading this article on pathfinding over polygon meshes using line-of-sight, and in the article are several code snippets. One of them, the one I'm trying to understand, is a simple function ...
245 views

### Determine if Plane is seen by Camera

If I have an arbitrary plane (center and normal) or a quad (center, normal and width and height) and a camera (frustum, projection & view matrix, etc). Then how would I go about calculating if the ...
296 views

### Intersection between moving circle and some squares

I'm developing a 2D game made of squares. What I need to do is check if a circle collides with any of the squares as it moves. I have a raycast function to check the same idea, but using a point. I ...
333 views

### Moller Tri Tri intersection

I'm done implementing Moller's tri-tri intersection routine. It gives you the location of where each triangle edge intersects the line of intersection between the 2 triangle planes: Really you get ...
82 views

### Get collision time between two moving, non uniform Axis Aligned bounding boxes

I have a problem finding the exact time of collision of two possibly moving or static objects. Both objects have AABB data (HalfExtents, Min, Max, Center vector and stuff) and a velocity vector. The ...
198 views

### What to do after detecting OBB-OBB intersection

I'm using this code to detect intersections between two OBBs. The problem is that i don't know what to do after detecting it. I tried using a simple algorithm: if (collision detected) { ...
621 views

### how to calculate intersection time and place of multiple moving arcs

I have rocks orbiting moons, moons orbiting planets, planets orbiting suns, and suns orbiting black holes, and the current system could have many many layers of orbitage. the position of any object ...
369 views

### How can I compute the common points when spheres intersect?

When two spheres intersect they should share one or two points. I want to know how to compute those points? I was thinking of something like this: -check if the spheres intersect -calculate ...
3k views

### Line Intersection from parametric equation

I'm sure this question has been asked before. However, I'm trying to connect the dots by translating an equation on paper into an actual function. I thought It would be interesting to ask here instead ...
422 views

### Checking if a vector is contained inside a viewing frustum

I have a three dimensional pyramid given by four vectors a, b, c, d and want to test if a given vector x is inside that region or not. Here is an image: A related question can be found here: 2D ...
197 views

### Calculate intersection of a line with a plane

I was reading something about: “Intersection of a line with a plane”. But I don’t fully understand how to calculate it on their way. The goal is to calculate where the plane and the line will “cross”....
158 views

### Rigidbody physics concept: Why translate collision shape on-the-fly instead of mutating it?

Crossposting at http://stackoverflow.com/questions/29993547/rigidbody-physics-concept-why-translate-collision-shape-on-the-fly-instead-of-m I've spent some time going through physics engine's ...
280 views

### How do I compute the point of a triangle-ray intersection?

I have a line (the direction vector of the player) and a triangle representing the face of a model (so composed of 3 points). I can't find the mathematical operation to check if that vector is ...
2k views

### Find meeting point of 2 objects in 2D, knowing (constant) speed and slope

I have a gun which fires a projectile that has to hit an enemy. The problem is that the gun has to be automatic, i.e. - choose the angle in which it has to shoot, so that the projectile hits the enemy ...
49 views

### My intersect detector isn't working

I'm trying to create rooms dinamically by creating them in random places and checking if they do overlap each other. The idea is that if the new room intersects with another one, it must be recreated ...
818 views

### Finding Z given X & Y coordinates on terrain?

I need to know the most efficient way of finding Z given X & Y coordinates on terrain. My terrain is set up as a grid, each grid block consisting of two triangles which may be flipped in any ...
71 views

### I need to find intersection point of a vector in an axis aligned rectangle

I need some help, I have one vector in a rectangle like following (Ops, first A2 point on the top should be A1, assume it is A1) Let's say the vector is like above It doesn't have intersection ...
304 views

### What is a technique for 2D ray-box intersection that is suitable for old console hardware?

I'm working on a Sega Genesis homebrew game (it has a 7mhz 68000 CPU). I'm looking for a way to find the intersection between a particle sprite and a background tile. Particles are represented as a ...
50 views

### What is the best way to check for intersection of two bounding boxes, given a minimum and maximum Vector3 for each one

I have a BoundingBox object which holds two Vector3's (x, y, z), one for the minimum point and one for the maximum point. (-1.5 0 9 | 1.5 3 10) What is the best way to check for any intersection or ...
142 views

### Section cut through (solid) geometry

I'm looking for image based (screen space) technique to render section cuts through arbitrary (solid) geometry. I found and studied image based CSG (Kirsch 05 / OpenCSG) but I found it to be perhaps a ...
2k views

### Collision/Intersection of (2D) Ray to Line Segment

Given a ray (r0, r1) and a line segment (a, b), I need to calculate the normal of the line segment based on the direction of the ray. For example, in the following picture: The correct normal given ...
536 views

### Is this the correct way to detect ray-sphere intersection?

I have this java function that should return a true or false for any sphere passed to it if they intersect. However it seems to end being true a lot of the time when it shouldn't and false sometimes ...
135 views

### What does Rectangle.Intersect means/do?

Ok I have two rectangles one is the ball and other is the paddle. 1. if(ball.rectangle.intersects(paddle.rectangle)) y = -Math.Abs(y); and 2. if(paddle.rectangle.intersects(ball....
390 views

### Wrong intersection: Bounding Sphere and Ray

I've got a huge problem with BoundingSpheres and Rays in XNA and I really don't know how to solve it. The problem: foreach (BoundingSphere s1 in GetCollisionHullBoundingSpheres()) if (ray....
1k views

### Segment-Cylinder intersection

What is the complete code (C#, pseudo, does not matter) for calculating the resulting segment (or its absence) for the intersection of asegment and a cylinder? The segment is defined by Vector3(x,y,z)...
95 views

### Best way to find line segment intersection

I need to find the point of intersection between two line segments in 2D space. I receive them in terms of both coordinates of both lines. Because they are line segments I would also need to know if ...
464 views

### Java 2D Game Hitbox Detection & Rounded Corners

I am working on a simple 2D game with Java, swing and no framework. I have a rectangular player that the user can move around. On the map are few obstacles which the player should not be able to go ...
117 views

### Warp GameObject Size When Entering/Leaving Area

Below I have an image describing the desired functionality I am going for. Let's say you control a square and when you move this square into a given area, any part of your rigidbody/model inside of ...
31 views

### Explanation of the parameters in the line intersection code

I am trying to understand a C code that moves the mesh nodes for each time step and i am totally struck on the parameters t1 and t2 please help me sorting this out. So here is what the function gets (...
187 views

### Ray & Segment Intersection

I'm writing some code to check intersection between all of a rectangles segments and a ray. It will sometimes use the Left and Right side of the rectangle as the closest face hit (face DA & BC) ...
69 views

### Cutting a 3D mesh with a 2D shape

I have a 2D image that i want to use to cut into a 3D mesh while leaving it closed (basically cut straight through it, and close it by generating vertices in both places it cut, front and back, to ...
162 views

### XNA Calculate two points of triangle with given Z

I want to calculate the two points of a 3D triangle that have a specified Z coordinate. I guess the way to do this would be to somehow create a plane which is perfectly flat with my given Z coordinate ...
372 views

### Sketchy results from ray-plane intersection code

I've set up a demo with simple first-person controls using C++ and OpenGL, and it seems to work reasonably well. My goal is this: when the player looks at a plane and clicks the left mouse button, ...