# Tagged Questions

A 2D shape consisting of straight lines that are joined to for a circuit.

2answers
4k views

### How do I handle collision detection so fast objects are not allowed to pass through walls?

I'm creating a 2d sidescrolling shooter, and I'm having a little trouble with collision detection for the bullets. Everything including the bullets are objects with their own polygons / update methods....
2answers
4k views

### How can I get textures on edge of walls like in Super Metroid and Aquaria?

Games like Super Metroid and Aquaria present the terrain with the other facing parts having rocks and stuff while deeper behind them (i.e. underground) there's different detail or just black. I ...
1answer
5k views

### A* navigational mesh path finding

So I've been making this top down 2D java game in this framework called Greenfoot and I've been working on the AI for the guys you are gonna fight. I want them to be able to move around the world ...
5answers
11k views

### Any reliable polygon normal calculation code?

Do you have any reliable 3d polygonal face normal calculation code? Any language will do, I'll port it to make it work. Even if you find some code in a 3d game engine and post it here I'll be more ...
1answer
345 views

### Is there any heuristic to polygonize a closed 2D raster shape with n triangles?

Let's say we have a 2D image black on white that shows a closed geometric shape. Is there any (not naive brute force) algorithm that approximates that shape as closely as possible with n triangles? ...
5answers
1k views

### How can I tell whether an object is moving CW or CCW around a connected path?

Lets say we have a jagged shape: And two creatures moving along it's outline. Then we smooth the shape completely by pulling the corners out. We get this: It is easy to see now that Orange is ...
2answers
2k views

### How to create 2D game terrain?

Last month, I experimented a lot in game development using cocos2d for the iPhone, especially on moving and modifying sprites. However, vertices and polygons are still new stuff for me. I developed ...
2answers
779 views

### Subdividing a polygon into boxes of varying size

I would like to be pointed to information / resources for creating algorithms like the one illustrated on this blog, which is a subdivision of a polygon (in my case a voronoi cell) into several boxes ...
1answer
546 views

### How to make a stack stable? Need help for an explicit resting contact scheme (2-dimensional)

Previously, I struggle with the sequential impulse-based method I developed. Thanks to jedediah referring me to this paper, I managed to rebuild the codes and implement the simultaneous impulse based ...
3answers
2k views

### How can I add and subtract convex polygons?

I have two 2D convex polygons overlapping each other. I am looking for an algorithm to subtract and add them. The result must be a single concave polygon or (even better) a set of biggest convex ones ...
1answer
243 views

### Algorithm for approximating sihlouette image as polygon [duplicate]

Possible Duplicate: Is there any heuristic to polygonize a closed 2D raster shape with n triangles? I want to be able to analyze a texture in real time and approximate a polygon to represent a ...
3answers
2k views

### How did they do it: Trine 2.5d terrain?

How did they make the terrain in trine? I think they took a polygon approach. It doesn't seem that they used a heightmap because it is in all three vectors, or a voxel method because it doesn't have ...
1answer
454 views

### How can we match polygon data structure with a background image

I am referring to this fireball game. The ball will collide with background, which is in polygon form. I was wondering, how I can match my polygon data structure with the background image. Say, I ...
2answers
1k views

### I need help with 2D collision response (of stacking rotating polygons, with friction and gravity, for a game)

Hi I am looking for suggestions on how to write a collision response for game programming purpose (so not a scientific simulation). I am dealing with 2D polygons that are rotating, and I want them to ...
2answers
914 views

### Scan-Line Z-Buffering Dilemma

I have a set of vertices in 3D space, and for each I retain the following information: Its 3D coordinates (x, y, z). A list of pointers to some of the other vertices with which it's connected by ...
3answers
624 views

### Adding tolerance to a point in polygon test

I've been using this method which was taken from Game Coding Complete to detect whether a point is inside of a polygon. It works in almost every case, but is failing on a few edge cases, and I can't ...
1answer
164 views

### Ray tracing - draw polygon (square/bounded plane)

I'm going on with my own ray tracer as an iPad app for a school project. This is the result with soft shadow, antialiasing, pure reflective and pure transparent object: Now i want to change the ...
1answer
238 views

### Scanline filling of polygons that share edges and vertices

In this picture (a perspective projection of an icosahedron), the scanline (red) intersects that vertex at the top. In an icosahedron each edge belongs to two triangles. From edge a, only one triangle ...