After hours of searching I want to ask now:
How I can detect the x/y positions of all corners from a png?
http://s13.postimg.org/ed5iqzkl3/vertices.png
Can you tell me how I proceed I must? Or exists a lib or something else?
Related
I am trying to implement a ear clipping algorithm into a program of mine but I am having issues. While that I can get it to work in a lot of situations, I haven't found a good way to check for reflex angles.
I've been looking up ways - every method I've tried to date seems to have angle it won't work for. When I try to find more information, most people's tutorials/work just tell me to "find the reflex angle and test for ear" then describe how to test for ear but not how to get the reflex angle.
Can anyone tell me how to get the proper angle inside the triangle for a concave polygon, or point me in the right direction? Could be an understanding issue with me. Thanks.
Figured out my problem was one of how I was conceiving the issue. I was saying that if the point was outside the polygon it could still be in the polygon without adding in my head the fact I removed the last vertex. Been busting my brains trying to implement ear clipping for a few days and got it wrong at this point - the solution was the basic "check if the center point of the triangle was outside the polygon and mark it as reflex".
Im writing a game in XNA and Im working right now in the pathfinding of the AI.
In my map there are some circular obstacles and I would like to use the mesh navigation technique (http://udn.epicgames.com/Three/NavigationMeshReference.html) so previously I need to convert those obstacles in a set of convex polygons.
Something like this:
Ive been searching in google for long time but couldnt find how to do it. Any clue?
Thanks!
Is a Delaunay triangulation what you are looking for?
I would like to draw sector of circle on map defined by point, radius, startAngle and stopAngle. I found lots of exmaples but with polygons etc whitch was too complicated for my case.
Thanks for any help!
a Circle is an object with no defined sides. Only a radius and a center point.
You are required to use a polygon to build a semi circle as it is a two sied object
There is not always an easy way out in coding, and typicaly they are the bad ways to do things (unless your talking about somthing like JQ/Bootstrap)
Here is a fairly stright forware implementation
http://googlemaps.googlermania.com/google_maps_api_v3/en/draw-semi-circle.html
This was refered in this question
Google Maps Polygon Incorrectly Rendered
they even provide a working example for you to rip apart
http://maps.forum.nu/temp/gm_bearing.html
How to place marker inside polygon (this polygon already on map)?
My thoughts are: find a way to inscribe for example circle to the polygon and find a center of this circle (it is not problem), but can't find way to inscribe circle.
Method getCenter() on LatLngBounds works not as expected, because math center of polygon can be out of this polygon visually.
As said Dr.Molle this is really duplicate of this question. So, for get center of polygon need to use programm realization of anything math algorithm for find center of polygon, there is no more easy way unfortunately.
i haven’t been entirely sure what to google or search for to help solve my problem, really hoping someone here can help a little…
currently i have a 3d scene, it has a massive sphere with a texture mapped to it and the camera at the center of the sphere, so it’s much like a qtvr viewer.
i’d like a way to click on the polygons within the sphere and update the texture at that position with something and dot etc..
the only part of the process where i need help is converting the 2d mouse position to a point on the inside of the sphere.
hope this makes sense…
fyi, im only looking for a pure math solution..
The first thing you need to do is convert the screen coordinate into a line in 3d space. This will pass through the point you click and your eyepoint.
Once you have this line you can then intersect this line with your sphere to find the intersection point on the sphere.
You may get 2d coordinates of the polygons (triangles?) that are making up the sphere and then find the one that contains the mouse pointer point.