The 2024 Developer Survey results are live! See the results

# Questions tagged [intersection]

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

102 questions
Filter by
Sorted by
Tagged with
32 views

### Implementing Intersection Logic and Mesh Construction for Procedural Spline-Based Roads in Unity

I’m currently working on a project in Unity where I’m creating procedural roads based on splines. At present, the roads are implemented by extruding a 2D shape along a spline or a straight line, ...
75 views

### How to tell when calculating an Intercept Point between two moving objects, when it will never intercept?

I'm not a maths person and the formulas you see on maths type questions/answer with all the symbols is completely beyond me - I'm sorry. However I had help about 18 months ago to turn a provided ...
34 views

### Ray-Sphere Intersection Always States Ray Origin Is Point Nearest Sphere Center

I am writing a simple graphics engine using Rusts WGPU. I have a Sphere rendering at the origin of my scene like so: ...
132 views

### Fast way to calculate angular intervals and occlusion of circular objects in a 2D vision cone

Say I have an agent in 2D in a world filled with circular obstacles of different kind and across many scales (some may be very large, practically filling an agent's view, some may be very small). The ...
• 121
78 views

### Ray-Square Intersection where the Ray always lies on the Interior of the Square?

I recently wrote a quick shader toy for finding the point of intersection of a ray centered within a square--with optimization provided by the Graphics Programming discord: https://www.shadertoy.com/...
• 123
198 views

### How to test for intersection of a cone with infinite camera frustum (no near/far plane)?

I have a given infinite camera frustum defined by four planes, each defined by a normal (left, right, bottom, top). From those planes we can also easily get the camera position and the view direction. ...
18 views

### How can I halt a check for intersections of sets in python when it discovers one member of the intersection?

How can I halt a check for intersections of sets in python when it discovers one member of the intersection? I want to do this so that when checking for collisions the moment an intersecting point is ...
• 9
195 views

### X axis intersection with inverted Y axis coordinates

I'm making a visual clue for the player to know where (and more or less when) an asteroid is going to enter the screen. For this I'm using a triangle pointing at the incoming object and color ...
• 376
1 vote
169 views

### Determine if a triangle is on the screen

I am working on a small software renderer, and I want to discard invisible triangles from the drawing process. Let's say I have a screen with resolution of 200x100 pixels. The triangle is defined with ...
• 349
1 vote
393 views

### How to snap a point to the height of the navmesh surface?

I'm making generator for EQS and need to put points on navmeshes located on different heights, one above other. So, my idea is to make raycast vertically and find intersection points with navmeshes. ...
• 251
226 views

### How inefficient is my ray-box-intersection algorithm?

One of the most critical parts of my raytracer is the calculation of a collision between ray-box which is done following way: ...
• 51
141 views

### How to check if a point is on the plane given bottom-right point, top-left point, normal and the quaternion rotation of the plane

I know the world positions of A and B. We are also given the vector normal and the quaternion rotation of the plane How do I check if a point lies on the plane?
• 331
1 vote
2k views

### How to perform a fast ray cylinder intersection test? [duplicate]

I need an algorithm in c++ to get the intersection point of a line if there is an intersection. My cylinder is defined by a 3d vector center point, a float height and radius. I don't need to take ...
• 15
446 views

### Understanding this terrain intersection algorithm

I was looking for a fast way to get a ray intersection point of a terrain defined by a heightmap and I stumbled upon this: https://publications.lib.chalmers.se/records/fulltext/250170/250170.pdf At ...
• 15
1 vote
175 views

### Fast self collision/intersection detection algorithm for tetrahedral meshes

I want to play with deformation of tetrahedral mesh (soft-body simulation) but I need help with self-collision detection stuff. I found SOFA collision detection but I'm not sure that it fits for self-...
• 201
89 views

### Collider inside another collider: Move the brain via mouse while being able the click the spheres

The spheres have a sphere collider on them and are clickable via this script:Clickable.cs ...
1 vote
1k views

### Ray-Box (AABB) is slower than without

I'm trying to write my own ray tracer. The last days I tried implementing a bounding box algorithm for it. But I'm getting a much slower frame rate with the bounding boxes turned on. I think it has ...
813 views

### Intersection of ray and non-axis-aligned box

I need to compute the intersection of a ray with a non-axis aligned box. Currently, I transform the ray into the local space of the box, do classic ray-AABB intersection and transform the intersection ...
• 101
80 views

### Auto-generate optimal direction for Unity Raycast with specifications

How can I have a Physics.Raycast auto-generate a direction for itself to try to hit a given target through a restricted window of space? [Update] After much work, ...
• 105
250 views

### How to highlight intersection between objects?

I'm new to Unity and I'm developing an augmented reality app. My situation is as follows: I have two objects in the scene, a neighborhood model and a cube. The mockup will be the object I am going to ...
85 views

### How can I spawn objects in a volume without intersection?

I am generating a 3D scene that involves spawning lots of 3D objects in a finite volume. I need to avoid intersection of objects.
• 113
217 views

### Collision detection - formula for getting intersection point

I need help with collision detection algorithm from this paper: http://www.peroxide.dk/papers/collision/collision.pdf I assume I am colliding with sphere of radius 1, just to make everything not ...
• 101
180 views

### Having some trouble with my frustum checking code

I'm trying to check if a bounding sphere is either within or intersecting my frustum. It mostly works but there are cases where it should and it doesn't. The frustum is made up of 6 planes which have ...
680 views

### How do I test for intersection of a ray and part of a capped cone / cone frustum?

The formulas to calculate the intersection between a ray and a capped cone / cone frustum are already widely known (see http://lousodrome.net/blog/light/2017/01/03/intersection-of-a-ray-and-a-cone/ or ...
204 views

### Show the edges between the clipping plane and clipped objects

I want to utilize shaders to not only discard fragments if they are on one side of a predefined plane but also render a contour along the intersection. My fragment shader currently does something ...
1 vote
76 views

### Sum of FoV enemies

so what I need is to calculate the sum of players' Field of view. Put simple, In a 2d space, I want to check how much they cover (in degrees). So here are a couple of use cases to explain by example: ...
1 vote
534 views

### How can I draw Polyline and detect its collision with other objects?

The idea is to draw trace of moving Actor and if some other Actor intersect it, some function would be called. I've been searching for solution to this problem in Intersector class, but it seems to ...
• 169
1 vote
673 views

### Find hexes on a hex grid given an angle

I'm trying to find an elegant solution to calculating the x, y values of hexes that are crossed or intersected by a line or ray at a given angle from a given hex position on a hex grid. I do not want ...
• 111
105 views

### How to draw circular sectors on polar grid only within bounding rectangle

I'm attempting to optimize a game map by only drawing circular & annular sectors within the current viewable rectangle bounds. The solution should cover both cases in the example graphic (Figs 1 &...
• 21
123 views

### Intersection point of two lines with given formula

I have following formula to check the intersection of two line segments: ...
• 569
761 views

### Intersecting Triangle and BoundingBox in 3D environment

I am trying to check if a triangle is intersecting a BoundingBox in a 3D space with libgdx, but I am unable to find anything that can help me with that. I tried using a Plane but it is not precise ...
3k views

### How to stop sprite when overlap on in libgdx?

How can I stop my player if he overlap or touch the ball? In my top down game my player is cat and I want to stop his moving or stack in that place of the ball is located if he hit the ball I'm using ...
894 views

### line segment triangular-prism intersection

What is the best way how to perform intersection test between triangular-prism (used as bounding "box") and line-segment (NOT ray)? The triangular prism is not axis-aligned and it is stored as a ...
398 views

### Möller-Trumbore false positive result in specific point

I copied code from this whitepaper and i can't figure out while it gives me false-positive intersections. Here's problematic values: Triangle points: (100.0, 100.0, 100.0), (-100.0, 100.0, 100.0), (-...
336 views

### Physics for curved edges?

I'm learning how to program simple two-dimensional games in C++ using SFML, I've done a relatively simple pong game already I would like to ask how I could go about creating the physics for a curved ...
1 vote
176 views

### Intersection of two limited planes (stripes)

Have two limited planes. That means just squares or stripe in 3D space (or two connected triangles on the same plane). What I want to know is exactly how (and whether) they collide. My first approach ...
• 165
1 vote
937 views

### Overlap color between objects

I'm currently trying to build a game with Ogre3D that is basically a moving vehicle that leaves a green trail (2D manual mesh) in it's path, what i'm trying to achieve is exactly what this image shows:...
• 83
1 vote
472 views

### Clamp point to triangle for sphere collision

I'm having some issues clamping a 3d to barycentric triangle. I've searched for some time now and keep seeing the same results, that (u,v,w) should be clamped between 0 and 1. But when I clamp those ...
14k views

### What is the fastest algorithm to check if two cubes intersect (where the cubes are not axis aligned)?

I am looking for an algorithm to check if two cubes intersect. One can check if each of the 6 faces of cube A are intersected by each of 12 edges of cube B, but that is 72 checks. I've heard there is ...
• 233
924 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 point ...
• 123
3k 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 ...
• 392
1 vote
2k 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 ...
• 13
5k 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 ...
1 vote
3k 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 ...
• 173
455 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 ...
• 222
6k 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. I ...
• 1,112
25k views

### Intersection of a Line Segment 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, ...
397 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...",...
• 4,887
1 vote