Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

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

1
vote
2answers
32 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 ...
1
vote
2answers
43 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 ...
0
votes
0answers
11 views

How to compute volume of intersection of non-axis-aligned cuboids in 3D?

Given two cuboids in 3D space (8 vertex coordinates each) that are arbitrarily oriented, how can we find the volume of overlap between them in the fastest manner?
2
votes
0answers
44 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 &...
0
votes
1answer
73 views

Intersection point of two lines with given formula

I have following formula to check the intersection of two line segments: ...
0
votes
1answer
119 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 ...
4
votes
1answer
757 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 ...
0
votes
2answers
261 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 ...
0
votes
1answer
146 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), (-...
2
votes
2answers
194 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 ...
0
votes
1answer
50 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 ...
0
votes
1answer
264 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:...
1
vote
1answer
102 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 ...
6
votes
1answer
2k 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 ...
2
votes
1answer
264 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 ...
2
votes
1answer
360 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 ...
1
vote
1answer
71 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 ...
3
votes
2answers
1k 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
2answers
1k 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 ...
4
votes
1answer
132 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 ...
15
votes
3answers
3k 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 ...
3
votes
4answers
4k 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, ...
5
votes
2answers
216 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...",...
1
vote
0answers
58 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 (...
1
vote
2answers
1k 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) ...
0
votes
0answers
69 views

Integer ops only 3D triangle-triangle collision detection

I've a need for 3D triangle-triangle collision detection using integer math only. Unfortunately, I'm not in a position where I can use 64-bit integers (only 32-bit) and my vertex values can be larger ...
3
votes
1answer
66 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 ...
1
vote
1answer
224 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 ...
1
vote
3answers
1k 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 ...
2
votes
1answer
201 views

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

Crossposting at https://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 ...
0
votes
2answers
851 views

Moving OBB vs. triangle intersection test

Requirements: to write a test function that, given a moving OBB (oriented bounding box) and a triangle, returns true whenever the OBB hits the triangle. The OBB is ...
0
votes
1answer
232 views

How to represent ray and line segment in parametric form?(Visibility)

I am trying to implement this algorithm but am not sure how I am supposed to represent my ray and my line segments(walls). For the r_px/r_py do I just use the position of the light? For the r_dx/...
4
votes
2answers
545 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 ...
1
vote
1answer
103 views

Finding the side of a shape a ray intersects

For some simple 3D shapes (cubes, prisms) how can I determine which side a ray intersects, knowing the direction of the ray, and the normals of the shapes' sides. I thought of using plane ...
0
votes
0answers
102 views

Displaying intersection by removing vertices

I am using WPF, using the MeshGeometry3D class to build up my model. I have 2 pipes intersecting each other, and I would like to remove the region of intersection (meaning erase the portion of pipe 1 ...
3
votes
2answers
485 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 ...
2
votes
1answer
4k views

Triangle-Triangle Intersection Code

Does anyone have experience implementing this triangle-triangle intersection code that I found online? I don't understand it. I made a post on Stack Overflow about this and got the advice that: ...
0
votes
1answer
5k views

How to calculate ray polygon intersection? [duplicate]

I'm in a class where we are creating a ray tracer from the ground up in C++. I'm at a point where I can't seem to wrap my head around the math that is required to calculate the point at which a ray ...
2
votes
1answer
3k 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 ...
8
votes
2answers
828 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 (...
1
vote
1answer
121 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 ...
4
votes
1answer
808 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 ...
3
votes
2answers
2k 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 ...
0
votes
0answers
144 views

Precalculating timespan of bullet collision on cubic bezier curve circles?

I'm fairly new to game logics, C#/XNA (The language/library of choice) and bezier curves in general, and is stuck in my current project. I'm going to try to explain as thoroughly as I can what the ...
1
vote
1answer
904 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 ...
0
votes
2answers
322 views

Thick Ray interaction with AABB

I would like to intersect a thick ray (actually a cylinder) with an AABB. The current code to perform intersection with the ray is the following. ...
2
votes
1answer
431 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 ...
2
votes
2answers
706 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 ...
0
votes
1answer
359 views

Tennis game algorithm and maths

Tennis courts are real dimensions and game is 3D Ball has position (x,y,z), speed(vx,vy,vz) and acceleration (ax,ay,az) Game has 30 fps and on each update (1/30sec) it has these properties ...
2
votes
1answer
1k 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 ...