Actionscript 3 :: Breaking A Concave Polygon Into Convex Ones

Mar 16, 2010

I'm using a game physics library (Box2D) which only supports convex polygon shapes. However, I'd like the level builder to be able to just specify concave polygons without having to worry about that. So, how can I automatically break apart a concave polygon into convex ones (or even all triangles). Speed would be cool, but ease of implementation is more important. The breaking apart will only be done on game initialization.

View 2 Replies


Similar Posts:


ActionScript 3.0 :: Know Whether It Is Concave Or Convex?

Aug 7, 2010

Given the points to a polygon. How would you know whether it is concave or convex? Is it possible to calculate that?

View 2 Replies

Flex :: Calculating The Area Of A Polygon When The Polygon's Points Are Lat Longs: Which Function Is More Accurate?

Jul 28, 2010

I'm trying to find a way to calculate the area of a polygon using lat long coordinates in a Flex 3 site. Hong007 on Google Maps for Flash group was cool enough to post the following function:

[Code]...

I was also playing around with the area calculator at [URL]. These functions produce slightly different results. I'm trying to figure out which one is more accurate. It seems that hong007's function produces results that are on average slightly larger than freemaptools' function. However, I don't know which one is more accurate.

View 2 Replies

ActionScript 3.0 :: Polygon Drawing App?

Aug 10, 2011

I want to create an app for drawing polygons with a variable number of vertices, with the following requirements (very similar to a vector drawing program such as Adobe Illustrator):

-each click of the mouse on the stage sets a vertice (e.g. draws a small square or circle to mark the spot), which draws a line to (e.g. LineTo) the prior vertice, and so on, until the final click, if close enough to the first vertice, will complete and close the polygon

-each of the vertices of the completed polygon should be draggable with the mouse, so that that completed (or partially completed) polygon maintains its integrity while changing shape, that is, so the user can modify the polygon shape without having to redraw it. it's the second step I'm having the most difficulty with...in general terms, how would I implement this? Perhaps each vertice should be a draggable Sprite containing a small square or circle graphic?

View 8 Replies

Professional :: Getting Points Position From A Polygon?

Jul 1, 2011

if there is a way to get by Actionscript the position of points in a polygon made using Pen Tool?

View 3 Replies

ActionScript 3.0 :: Create Polygon From Array?

Jun 30, 2009

I'm trying to figure out how to draw a polygon from an array. I've found a few examples, one which the author says works, but am not getting anything to appear. I've traced the array (it's registering) and am getting no errors.

Code:
//called from constructor
polygon(thisArray);

[code].....

View 1 Replies

ActionScript 3.0 :: Get Pixels Of Bitmap From Polygon?

Mar 20, 2011

I know that I can collect the pixels of a rectangular area within a Bitmap using getPixels(), but is there a way to collect the pixels of a polygonal area with more than 4 points? Or at least determine whether a particular pixel lies within a polygonal area of a Bitmap?

View 7 Replies

Actionscript :: Fill A Polygon With A Solid Color?

Oct 8, 2009

I'm building a map editor for a project and need to draw a hexagon and fill it with a solid color. I have the shape correct but for the life of me can't figure out how to fill it. I suspect it may be due to whether the thing is a Shape, Sprite or UIComponent. Here is what I have for the polygon itself:

import com.Polygon;
import mx.core.UIComponent;
public class greenFillOne extends UIComponent {

[Code].....

View 2 Replies

Flex :: 3D Object Compression (By Polygon Reduction)

Jun 11, 2010

I wish to develop a software for 3D object compression (by polygon reduction) in flex using papervision 3D.

View 1 Replies

Add A Polygon As A Marker In Google Maps Flash Api?

May 9, 2011

I am creating a project in Flash using the Google Maps API and docs. I'm trying to add a marker to the map, which is draggable but I don't want it to look like the standard Google Maps bubble-style marker. Is it possible to have a custom polygon or image but still keep the draggability?

View 2 Replies

Actionscript 3 :: Creating A Polygon From A Set Of Coordinate Pairs?

Dec 12, 2011

I'm making an app in Flash, and I want to define some polygons which I can bind hover events to to add annotations to an image.I can create these normally in Flash, but I want to load some external data, a list of coordinates, and create the polygons with ActionScript.

Obviously they're just hotspots, so I want them to be invisible, but searching for my problem only shows results for drawing polygons from coordinates using the graphics property of a movieclip.The data doesn't ever change, so it would be possible to just draw all the polygons manually with the pen tool, but the data is being used elsewhere, so it would be much easier to maintain if I could add new zones just by updating the text file.

View 2 Replies

ActionScript 3.0 :: Line - Polygon Intersetion Detection?

Aug 25, 2011

I'm working on a method to do more accurate path finding for a special project. I haven't yet found any sources on this so i have to write it myself.

The idea was to use a polygon mesh, draw waypoints between all points then discard ways intersecting with a polygon. After that use dijkstra's algorithm to find the closest path.

Detecting whether a line intersects with a polygon mesh is the tricky part. I haven't yet come up with any viable solution that is fast. how i can determine whether a waypoint travels through a polygon?

View 9 Replies

ActionScript 3.0 :: Flash Autofill Polygon In Real Time

May 25, 2011

I am creating a game where I have some red balls on the screen and some blue balls on the screen and I would like to draw a polygon around all balls of the same color and have this polygon automatically fill as soon as the polygon shape is closed. How to achieve this as I haven't really done much with the drawing API before. My current code will allow me to draw a polygon and for it to fill when I release the mouse but what I would like it to do is automatically fill as soon as the shape is closed.

Here is my code so far
Code:
var graphix = new MovieClip();
addChild(graphix);
var points:Array = [];
stage.addEventListener(MouseEvent.MOUSE_DOWN, startDrawing);
[Code] .....

View 2 Replies

Professional :: Can't Close Marquee Performed By Lasso's Polygon Tool?

Mar 18, 2011

When I double click to close the selection, the marquee vanishes instead of closing the selection.  Yes, I double click on the starting point.Here's what the manual proclaims (step 4):
Draw a straight-edged selection area1 Select the Lasso tools Polygon Mode modifier in the options area of the Tools panel.2 Click to set the starting point.3 Position the pointer where you want the first line to end, and click. Continue setting end points for additional line segments.4 To close the selection area, double-click.

View 1 Replies

ActionScript 3.0 :: Function - Drawing The Polygon Based On The Number Of Sides

Dec 29, 2011

I'm trying to create a function that draws a polygon with two parameters that are: number of sides and length of sides. You would input a number for side length and a number for the number of sides. Then it would draw the side length, then turn at a angle based on the number of sides, then draw side length again... until it has finished drawing the polygon based on the number of sides that were put in.

View 1 Replies

Flex :: Determine If A Series Of Points (or Polygon) Is Within A Rectangular Region?

May 20, 2011

I have been looking at posts about determining if a point lies within a polygon or not and the answers are either too vague, abstract, or complex for me. So I am going to try to ask my question specific to what I need to do.I have a set of points that describe a non-straight line (sometimes a closed polygon). I have a rectangular "view" region. I need to determine as efficiently as possible whether any of the line segments (or polygon borders) pass through the view region.

I can't simply test each point to see if it lies within the view region. It is possible for a segment to pass through the region without any point actually inside the region (ie the line is drawn across the region).Here is an example of what I want to determine (red means the function should return true for the set of points, blue means it should return false, example uses straight lines and rectangles because I am not an artist).

Another condition I want to be able to account for (though the method/function may be a separate one), is to determine not just whether a polygon's border passes through the rectangular region, but whether the region is entirely encompassed by the polygon. The nuance here is that in the situation first described above, if I am only concerned with drawing borders, the method should return false. But in the situation described here, if I need to fill the polygon region then I need the function to return true. I currently do not need to worry about testing "donut" shaped polygons

Here is an example illustrating the nuance (the red rectangle does not have a single vertex or border segment passing through the on-screen region, but it should still be considered on-screen):For the "does any line segment or polygon border pass through or lie on screen?" problem I know I can come up with a solution (albeit perhaps not an efficient one). Even though it is more verbose, the conditions are clear to me. But the second "is polygon region on screen?"PS I have a function for determining line intersection, but it seems like overkill to use it to compare each segment to each side of the on-screen region because the on-screen region is ALWAYS a plain [0, 0, width, height] rectangle.

View 2 Replies

ActionScript 3.0 :: Get The Polygon Boundary Points Of A Sprite Or Movie Clip?

Feb 5, 2009

I'm working on a pathfinding algorithim using A* and using irregular polygon shapes as obstacles rather than a grid. I don't fancy plugging in all the points and links by hand and was wondering if there was some way I could just get them from a Sprite or MovieClip?

View 1 Replies

AS2 :: Swf Breaking When Loaded Into AS3 Swf

Feb 5, 2010

i am using is flash cs3. the as2 swf contains a tween code using mx transitions.when i remove this tween code and hard code it on the enterframe there seems to be no problem.afaik avm2 should fully supports the as2 and as1 code. so i am unable to understand why this disparity when coding a simple tween in as2 swf.i had made a post in the actionscript forums hoping to gain some light on the issue.URL...[code]

View 2 Replies

IDE :: Multiple Images Breaking Swf?

Mar 23, 2009

what its meant to do: A casestudy, has a section for each client, showing a selection of work for each one. It starts at a random client/section each time it is loaded, and there is also a menu that allows you to go to a specific client/section if you want.

So what i've done is made a randomly generated var at frame 1, and then told it to gotoAndPlay different sections of my timeline

Code:
var myVar = Math.floor(Math.random() * 6) + 1;
if (myVar == 1) {
gotoAndPlay(5);

[Code]....

This is working fine, as is the menu. However, as soon as I add a new layer with 2 or more images, in any of the sections it stops working.

Stranger still, it seems to be if i use more than one of the same image type it wont work ie, 1 jpg, 1 gif, 1 png it still works, but if i have 2 jpgs or 2 gifs it will break.

I also tried making a movie clip to hold my images, but the same thing happens

View 5 Replies

ActionScript 3.0 :: Breaking A Video_mc In 2 Parts?

Jan 13, 2010

I saw a website where a video was breaking up in 2 parts.Is there an easy way to do that

View 7 Replies

Curves Straightening When Breaking Apart Text?

Oct 7, 2009

Just installed Flash CS4 and the first thing i realized was:When I break apart text the curves straightens in some places.Is there a setting i need to set up for this not to happen?Didn't have any problems in CS3.

View 1 Replies

Professional :: Animating A Breaking Board?

Feb 5, 2011

I am working on a project where I need to show a wooden board and have the user pick a place on the board and somewhat realistically (at least believable) simulate the board breaking and shattering at that point. The final product will need to run on a mobile platform so performance is an issue.I have already experimented a bit and have a movie clip board which is composed of predetermined pieces and I used a tween to move the pieces apart. The main problem is that the way the board breaks and where it breaks are predetermined

View 2 Replies

ActionScript 2.0 :: OnEnterFrame Breaking LocalToGlobal

Jan 13, 2009

I am using localToGlobal to get the _y coordinate of a nested movieClip in relation to the stage.[code]

View 1 Replies

ActionScript 3.0 :: Breaking Out Of Function Rather Than Loop

Jan 30, 2009

If I want to break out of a function rather than a loop, it's suggested that I use the return; statement. But that doesn't work in the following code, I just want the trace statement to run once...

Code:
stage.addEventListener(Event.ENTER_FRAME, EnterFrameHandler);
function EnterFrameHandler(event:Event):void {
trace("It worked, obviously.");
return;
}

So, this will trace the phrase over and over with no stopping point. Why doesn't return have an effect? Doesn't the first line only happen once... ?

View 2 Replies

ActionScript 2.0 :: Breaking A Received String From PHP?

Jul 23, 2006

I have written a php code to echo a string of all the fields' contents of a table (select * from x) now I want flash to display the table in a flash move. website where I can find a tutorial on how to receive and parse such string?

View 2 Replies

ActionScript 2.0 :: Breaking Down An Array Into Rows?

Oct 12, 2007

I have a datagrid that displays the contents of the array gotoArray[i], my only problem is that whenever an item gets added to the array the labels all go onto the same row instead of into sperate ones.

So it looks like this all on one row: Frame1, Frame2.....

Code:

_global.gotoArray = new Array(_global.BM_array);
function dataGridFunction() {
myDataGrid.setSize(260,115);

[Code]....

ALSO on an array note: How can I remove a value from an array according to it's index number - do I use the slice tool?

View 3 Replies

ActionScript 3.0 :: Breaking Video Into Frames?

Jun 10, 2009

[URL]Is it literally breaking the video into frames or is it instancing the video a certain number of times and offsetting the next/previous frame?if it's the latter ... what's the most efficient way to handle that number of duplicates? I figure doing it that way would be too processor intensive ...

View 14 Replies

ActionScript 3.0 :: Breaking Symbol Without Removing The Instance Name?

Dec 16, 2010

I selected all my stuffs & make them into a symbol and when i break the symbol up all the instance name was removed. Is there a way to break up the symbol without removing the instance name?

View 2 Replies

ActionScript 1/2 :: Swf Breaking After Using Firefox Back Button?

Oct 7, 2011

I have a problem with my swf freezing after navigating to it using the back button in Firefox 7.0.1 (mac) My swf has a set of buttons that link other non flash pages in the site.f you use the back button to navigate back to the page containing the SWF, the swf freezes. As far as I can tell it works on all other browsers and works on firefox on the PC.
you can see it in action here

View 13 Replies

Professional :: Keep A Movieclips Filter/tint Changes After Breaking Apart?

Mar 13, 2012

I'm currently working on combining a bunch of movieclips with variating color schemes that I'd like to condense into a unified pallete. Breaking apart a movieclip reverts the graphics to the original colors but it would be super-helpful if flash repasted the current color settings onto the graphics once its broken apart. Maybe implementing a few of illustrators color palette tools would be great too. If this isn't the proper place, then I apologize but I wanted to pass the info along as an artist who is currently using flash as his primary art development tool right now.

View 5 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved