concave

Libgdx polygon triangulation

你。 提交于 2020-01-23 08:05:13
问题 Ok, so I have a polygon (simple but concave) that I'm trying to cut into triangles to make it collide with an other polygon. I knew my polygone was concave, so i decided to use LibGDX EarClippingTriangulator to manage to cut it into triangles. So, with this code, I get my triangles vertices : public void triangulate() { Vector<float[]> trianglesVertices = new Vector<float[]>(); ShortArray pointsCoords = new ShortArray(); EarClippingTriangulator triangulator = new EarClippingTriangulator(); //

Is there an efficient\easy way to draw a concave polygon in Direct3d

风流意气都作罢 提交于 2019-12-22 09:45:38
问题 I'm trying to draw a polygon using c# and directx All I get is an ordered list of points from a file and I need to draw the flat polygon in a 3d world. I can load the points and draw a convex shape using a trianglefan and drawuserprimitives. This obviously leads to incorrect results when the polygon is very concave (which it may be). I can't imagine I'm the only person to grapple with this problem (tho I'm a gfx/directx neophyte - my background is in gui\windows application development). Can

Scaling an arbitrary polygon

不问归期 提交于 2019-12-22 05:24:14
问题 I've been scouring the internet for days, but have been unable to find a good answer (or at least one that made sense to me) to what seems like it should be a common question. How does one scale an arbitrary polygon? In particular, concave polygons. I need an algorithm which can handle concave (definitely) and self-intersecting (if possible) polygons. The obvious and simple algorithm I've been using to handle simple convex polygons is calculating the centroid of the polygon, translating that

Is there a way to create a concave physicsBody in SpriteKit?

末鹿安然 提交于 2019-12-12 09:58:11
问题 I have an object on scene and my hero should not go through it, but it should be able to go inside of it, like a boat into the bay, surrounded by the other element. I tried all kinds of physicsBody having it have body with rectangle, texture, with polygon from path, but to no avail. I was reading somewhere that it is not possible to have a concave physicsBody, but only convex. I really need it to be able to be concave. Does anyone know how to resolve this? 回答1: You can create a concave

Determine ordering of polygon 3D

前提是你 提交于 2019-12-11 09:03:42
问题 I have a list of vertices 3D, creating a polygon. I need to triangulate it and i use the cutting ears algorithm. My polygons are non-convex, so i need to find the concave angles in the polygon. I also dont know wich orientation are my polygons ( clockwise or counter clocwise) Could anyone help me how to determine if is clockwise or counter clockwise Thank you 回答1: It's probably simplest to project the polygon into a convenient plane (say z=0) and then use a method like reinier's. 1) Set all z

Drawing a concave polygon in OpenGL

二次信任 提交于 2019-12-07 01:51:52
问题 I have a concave polygon I need to draw in OpenGL. The polygon is defined as a list of points which form its exterior ring, and a list of lists-of-points that define its interior rings (exclusion zones). I can already deal with the exclusion zones, so a solution for how to draw a polygon without interior rings will be good too. A solution with Boost.Geometry will be good, as I already use it heavily in my application. I need this to work on the iPhone, namely OpenGL ES (the older version with

3D contour of a list of points (concave hull)

时光总嘲笑我的痴心妄想 提交于 2019-12-06 08:14:01
问题 I have a list of Vector3 points in c#, and I need to calculate the concave contour of these. There's really a lot of references around, especially for -convex- resolution (which I have successfully implemented already, thanks to graham's algorithm), however, since my need is now to effectively compute a concave contour, I'm lost: wikipedia does list a lot of resources for convex calculation, but none for -concave-. Anybody with math knowledge that can give me a lead on the available concave

Is there a way to create a concave physicsBody in SpriteKit?

狂风中的少年 提交于 2019-12-06 05:39:05
I have an object on scene and my hero should not go through it, but it should be able to go inside of it, like a boat into the bay, surrounded by the other element. I tried all kinds of physicsBody having it have body with rectangle, texture, with polygon from path, but to no avail. I was reading somewhere that it is not possible to have a concave physicsBody, but only convex. I really need it to be able to be concave. Does anyone know how to resolve this? You can create a concave physics body by adding up a bunch of convex physics bodies into one shape. Then you can add them as children to an

Is there an efficient\\easy way to draw a concave polygon in Direct3d

℡╲_俬逩灬. 提交于 2019-12-05 17:29:01
I'm trying to draw a polygon using c# and directx All I get is an ordered list of points from a file and I need to draw the flat polygon in a 3d world. I can load the points and draw a convex shape using a trianglefan and drawuserprimitives. This obviously leads to incorrect results when the polygon is very concave (which it may be). I can't imagine I'm the only person to grapple with this problem (tho I'm a gfx/directx neophyte - my background is in gui\windows application development). Can anyone point me towards a simple to follow resource\tutorial\algorithm which may assist me? Direct3D

3D contour of a list of points (concave hull)

久未见 提交于 2019-12-04 13:28:19
I have a list of Vector3 points in c#, and I need to calculate the concave contour of these. There's really a lot of references around, especially for -convex- resolution (which I have successfully implemented already, thanks to graham's algorithm), however, since my need is now to effectively compute a concave contour, I'm lost: wikipedia does list a lot of resources for convex calculation, but none for -concave-. Anybody with math knowledge that can give me a lead on the available concave hull algorithms? I have a concern for performance, too, so being able to benchmark the algorithm speed a