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

learn more… | top users | synonyms

0
votes
1answer
40 views

libgdx custom shape overlap detecting

I'm writing my game on libgdx w/o any of those extensions like box2d and whatsoever. But right now I'm forcing problem with overlapping detection. I need to detect if bullet (which is always in ...
2
votes
2answers
231 views

Calculate laser bounce inside polygon

I am trying to calculate the reflection of a laser within a polygon. My current calculations are probably quite long-winded because I'm building on line intersection and other functions. The problem ...
0
votes
0answers
40 views

Create Fog of war polygon obstacles

I'm doing a game (At this moment it's only a prototype using love2D) and I made a fog of war using a mesh over other things, and actually it's working, but I've got some assets (decoration for the ...
2
votes
1answer
116 views

How do I convert a partially transparent image into polygons?

I'm using GLEE2D, a level editor allowing me to import images, scale them, rotate them, and position them onto layers and export the data into XML format. However, it does not tell me objects' ...
2
votes
2answers
74 views

How can I test if a point is behind a polygon in 2D?

In order to improve the performance of my visibility graph generator I am trying to figure out the following. Given the image below; is there a way to find out if a point is 'behind' the polygon? For ...
7
votes
3answers
272 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 ...
0
votes
0answers
87 views

Calculate mass moment of inertia of two 2D polygons

For a small 2D physics engine I need to know the following. I wasn't able to find an answer even after a week of research. Hope you can help me. I have multiple concave 2D polygons that are tight ...
2
votes
3answers
880 views

Polygons vs sprites rendering performance in Unity for windows phone 8

I'm currently building a windows phone 8 game with unity, having 111 (no more no less) sprites being updated each frames. I have a strong overhead in the profiler (70% to 90% minimum) I tried the ...
-2
votes
2answers
100 views

How to calculate a bounding rectangle of a polygon?

Polygon poly = new Polygon(); poly.getPoints().setAll(5d, 15d, 15d, 25d, 5d, 30d); How do I calculate the Polygon's height and width? There is no poly.getWidth() or poly.getHeight() method in ...
-2
votes
1answer
63 views

What do the 6 points stand for in Polygon().getPoints().setAll?

I have the following code to create a polygon: Polygon poly = new Polygon(); poly.getPoints().setAll(14d, 17d, 26d, 17d, 20d, 27d); // What do these mean? What do these 6 points stand for?
1
vote
1answer
347 views

How can I drag a polygon based on a mouse-moved event?

I have drawn a polygon in Java using java.awt.Polygon. I want to move that polygon with the mouse (by dragging it). I know that I have to use mouseDragged method in addMouseMotionListener. That way I ...
6
votes
1answer
162 views

Separating axis theorem with multiple polygons?

I am attempting to implement the separating axis theorem in C#. I have a function that can calculate the minimum translation vector between two polygons. However, I can't seem to create a function ...
0
votes
0answers
28 views

Blendshapes workflow in mudbox

I am new to mudbox. I want to create a face with blendshapes. Currently my face has 24576 polygons on level 3. I would like to go to level 2 or level 1, ie lower than 6000, but there, detail suffers. ...
1
vote
2answers
122 views

Moai: Clipping an image to a polygon

I'm using Moai SDK. I have an image and some random convex 2D polygons. I want to show only the parts of the image inside these polygons. Here's an example image: The same, shown only where the ...
4
votes
4answers
186 views

What decrease of polycount should occur as a function of distance?

What decrease in polycount should occur as a function of distance. I make a terrain and I wounder what is the right formula to keep the "poly size"(the screen size) constant. Or is there some mental ...
4
votes
1answer
395 views

Polygon count budget

Is there any smart way to think about polygon budget relating to PC gaming today? My game will have one static 3d background scene and two fighters. No more enemies. I am thinking about having ...
2
votes
2answers
339 views

Would it be more efficient to handle 2D collision detection with polygons, rather than both squares/polygons?

I'm working on a 2D game engine and I'm trying to get collision detection as efficient as possible. One thing I've noted is that I have a Rectangle Collision collider, a Shape (polygon) collider and a ...
0
votes
1answer
281 views

Collision detection with multiple polygons simultaneously

I've written a collision system which detects/resolves collisions between a rectangular player and a convex polygon world using the Separating Axis Theorem. This scheme works fine when the player is ...
3
votes
2answers
219 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 ...
0
votes
1answer
80 views

Get polygons points from an array of 0 and 1

I have an 2D array containing 1 for walls or 0 for empty cells. I can draw my maze by iterating through the map, placing a wall when map[x][y] is equal to 1 but I want to get the points of the ...
7
votes
1answer
267 views

How do I get the areas enclosed by an arbitrary 2D shape?

In my game I want users to be able to draw arbitrary 2D shapes of any length around game objects. The shapes must be closed and drawn with a single stroke that does not overlap. For example: I ...
12
votes
3answers
648 views

What caused “falling out of the world” and what fixed it?

A lot of early 3D games had the problem where you'd be trundling merrily along and suddenly everything was black, with an island of what looked like the hollow facade shell of the scene you'd been ...
5
votes
2answers
189 views

Random 2D point in rectangle, but not in a polygon

I have a static rectangle and dynamic polygon. I need to generate a random 2D point in that rectangle, but not in a polygon. This is what I mean: Green is where random point can be generated and ...
0
votes
1answer
102 views

How to render polygons of arbitrary shape? [duplicate]

I am trying to render a plane with nodes. FYI : Nodes know what other nodes it is being attached to. I can think of a way to render them as long as they are aligned in a circular pattern; have a ...
1
vote
1answer
177 views

Generate inner polygon from a parent polygon

I want to produce a polygon inside an arbitary polygon. The inner polygon shall be distanced from the outer polygon with a fixed distance, d. I will use the inner polygon as a border for player ...
0
votes
2answers
199 views

games logic based on closed shapes

I would like to know the math concepts behind shape based games like http://www.miniclip.com/games/fat-slice/en/ To be specific, I would like to know on how to model shapes programmatically finding ...
2
votes
2answers
415 views

Farseer Physics: How to create shape from Vertices?

As you can understand from the title, I'm pretty new to game development. I'm doing this for fun. Anyway here's my question. I have this Farseer Physics samples and i've been studying them for a few ...
-1
votes
1answer
1k views

Create Box2D and engine polygon Box2D body without sprite

Hey I have created my body using following code: (please read full description) Body polyBody; final BodyDef mBodyDef = new BodyDef(); mBodyDef.type = BodyDef.BodyType.DynamicBody; ...
2
votes
3answers
3k views

Mesh with quads to triangle mesh

I want to use Blender for making models yet realize some of the polygons are not triangles but contain quads or more (example: cylinder top and bottom). I could export the the mesh as a basic mesh ...
1
vote
1answer
374 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 ...
2
votes
2answers
111 views

Splitting Graph into distinct polygons in O(E) complexity

If you have seen my last question: trapped inside a Graph : Find paths along edges that do not cross any edges How do you split an entire graph into distinct shapes 'trapped' inside the graph(like ...
18
votes
5answers
668 views

Moving CW or CCW?

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 ...
0
votes
1answer
164 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 ...
0
votes
1answer
264 views

Greiner-Hormann clipping problem

I have a set of planar polygons in 3D space defined by their vertices in counterclockwise order. Let's define the 'positive face' as being the face of the 3D polygon such as when observed, the ...
3
votes
1answer
151 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 ...
4
votes
1answer
253 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? ...
1
vote
3answers
5k views

How do I make a circular hole inside an editable poly without boolean operations?

I have created a rectangle, then converted it into an editable poly. Then I created a circle and converted it to editable poly too. How to make it so that that the circle becomes a hole in the ...
2
votes
3answers
316 views

Polygonal Triangulation - algorithm with O(n log n) complexity

I wish to triangulate a polygon I only have the outline of (p0, p1, p2 ... pn) like described in this question: polygon triangulation algorithm and this webpage: ...
3
votes
2answers
522 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 ...
2
votes
1answer
1k views

How can I make Maya export a mesh as double-sided?

I'm exporting from Maya 2009 to OBJ. The mesh I'm exporting has in it's Render Stats "Double Sided" checked, but when the polygon is exported, only a single side is actually exported. What really ...
1
vote
1answer
402 views

2D SAT Collision Detection not working when using certain polygons (With example)

My SAT algorithm falsely reports that collision is occurring when using certain polygons. I believe this happens when using a polygon that does not contain a right angle. Here is a simple diagram of ...
6
votes
3answers
935 views

Can a straight line be called a polygon?

According to the definition of Polygon, If a Poly-line's first and last points are connected then it is called Polygon. See the image below. I have P1, .... P5 Polyline. If I draw a line from P5 to ...
0
votes
1answer
191 views

How can I locate empty space next to polygon regions?

Let's say I have the following area in a top-down map: The circle is the player, the black square is an obstacle, and the grey polygons with red borders are walk-able areas that will be used as a ...
2
votes
2answers
183 views

How can I move a polygon edge 1 unit away from the center?

Let's say I have a polygon class that is represented by a list of vector classes as vertices, like so: var Vector = function(x, y) { this.x = x; this.y = y; }, Polygon = function(vectors) { ...
3
votes
3answers
392 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 ...
8
votes
2answers
2k views

How do I determine if one polygon completely contains another?

I have 2 polygons. I know the vertex coordinates of both polygons. What's the best way to check if one is completely inside the other? For example, the algorithm should only recognize the black ...
1
vote
1answer
301 views

How to decompose a rectangular shape in a Voronoi diagram, only generating convex shapes?

I think this is a very straighforward question, lets say i have a building in 2D, a rectangle shape. Now i want to decompose that area in a lot of convex shapes, as seen in a voronoi diagram, or ...
6
votes
1answer
625 views

Puzzle game: clipping of non-convex polygons on the figures

I have an original figure in the SVG file. I need to break it randomly on parts, an example of which is specified below: I have an idea, to use for partitioning Voronoi diagram (Fortune's algorithm). ...
5
votes
1answer
467 views

Algorithm for constructing the corners of a regular, n-sided polygon

I've googled this using a lot of keyword combinations, but to my great surprise I could not find an algorithm for constructing a regular, n-sided polygon into a given circle, i.e., finding the ...
5
votes
1answer
479 views

Do I need to roll my own polygon segmentation algorithm to automate Box2d body creation from a tile map?

Before re-inventing the wheel I figured I'd ask: I'm working on a tile-based 2d-maze level generator for cocos2d + box2d. The idea is: I'm using one of the well-known graph traversal algorithms to ...