Falling polygons: meshing vs. stacking - analytic solution needed

Click For Summary
SUMMARY

The discussion centers on a game development challenge involving 3D tangram pieces in a Tetris-like game using Unity. The developer faces issues with polygonal collision detection, where falling pieces incorrectly register overlaps with adjacent pieces despite proper alignment. The goal is to implement an analytic solution to determine if a specific space within the basin is occupied or vacant based on the positions of existing tangrams. The developer seeks guidance on mathematical approaches or programming techniques to resolve this collision detection problem.

PREREQUISITES
  • Understanding of Unity's physics engine and polygonal collision detection
  • Familiarity with 3D geometry and spatial reasoning
  • Basic knowledge of grid-based systems for game development
  • Experience with analytic solutions in programming
NEXT STEPS
  • Research Unity's collision detection methods and how to customize them
  • Explore grid-based collision detection techniques for 3D environments
  • Investigate mathematical concepts related to spatial occupancy and polygon fitting
  • Learn about implementing analytic solutions in game physics
USEFUL FOR

Game developers, particularly those working with 3D physics and collision detection, as well as programmers seeking to optimize spatial logic in gaming environments.

SLanghi
Messages
1
Reaction score
0
Falling polygons: meshing vs. stacking -- analytic solution needed

I'm a game developer and not a mathematics specialist, so I'm not 100% sure if this question is correctly categorized.

My problem is as follows.

I'm building a game that's similar to Tetris, but in 3D instead of 2D. Rather than arranging falling tetriminos to form lines within a grid, the player arranges falling tangram pieces to form squares within a square basin.

All of the tangram pieces occupy even fractions of a square (1/4, 1/8, 1/2). Furthermore, when a piece lands, each of its vertices aligns with one of the following: the corners of the basin, the midpoints of the basin's sides, or the central midpoint of the basin.

As the player guides the falling pieces, there will be cases in which a piece nestles just inside the vacancy formed by other, adjacent pieces. I need a collision-detection logic that can allow for these situations where the descending object "just fits" into a hole having the exact shape and size of the piece.

The polygonal collision engine I'm using (Unity) is exhibiting problematic behavior. Even when the tangrams' vertices are aligned exactly to the key points mentioned above, the physics-based polygonal collision logic registers an overlap between a falling piece and one of the pieces bordering the hole into which it's falling. As a result, the falling piece stacks on top of the other pieces, though it appears to the naked eye that the falling piece should have continued into the hole.

I'd like to use an analytic solution that can tell me whether a space within the basin having a particular shape at a particular location is occupied or vacant, given full prior knowledge of the tangrams already residing with the basin. I have very few ideas about where to start with this. If anyone can provide a solution method, or even point me toward the correct mathematical topic, I'll greatly appreciate it.
 
Mathematics news on Phys.org
Hmm, certainly not differential geometry. Either general math or programming.

If I understand your problem correctly, the polygon positions are discrete. Why don't you just make a grid and check if one element of it is occupied?
 

Similar threads

  • · Replies 5 ·
Replies
5
Views
5K
  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 8 ·
Replies
8
Views
5K