ActionScript 3.0 :: Calculating A Coordinate From A Distorted Rectangle?
Nov 5, 2009
I have a rectangle that I can calculate the corners of and I can detect a point within that rectangle, how do I determine the 2D-coordinate of that point if I were to try and project it on a non-distorted rectangle?
Code:
|
|
|
| |
[Code]....
I've tried many a Google search dealing with 3D Projection and and matrices, but I don't even know if I'm looking for the right things.
View 8 Replies
Similar Posts:
Jan 14, 2010
i'm in the middle of attempting to write my own collision detection algorithm because the built in 'hitTestObject' function seems to be incredibly inaccurate (it's registering 'hits' when the objects are still a considerable distance from each other).I need to be able to calculate the position of each of the 4 corners of a rectangle, based on its rotation. Obviously one of the corners will simply be the rectangle's x and y coordinates. I have made a little test program to make sure I am calculating the positions of the corners accurately - it works when the rectangle is rotated to 0, 90, 180 and 270 degrees, but produces strange results for any other angles.[code]
View 7 Replies
Dec 15, 2010
I am creating an app that has to load a image or swf on to the stage and dynamically place and position it on either sides of the stage i.e. (top, left, bottom or right).how can I dynamically calculate the remaining bounds of the stage using the bounds of the dynamically placed loaded image/swf. ?e.g if the bounds of the loaded clip isRectangle(x=10, y=10, w=250, h=800);What is the remaining Rectangle() to use ofRectangle(0,0,1024,800); ?
e.g if the bounds of the loaded clip is
Rectangle(x=0, y=0, w=800, h=50);
What is the remaining Rectangle() to use of
[code].....
View 3 Replies
Apr 11, 2007
I'm having a little difficulty getting to grips with the getBounds() Movie Clip function. I assumed the getbounds() method simply got the boundary coordinates for the movie Clip, that one could use to draw a rectangle. This is what I'm trying to do;I'm trying to get a movie clips coordinate bounds, and use the min and max values of x and y to draw rectangle around the object. Simple right? But in my case, I'm getting some unexpected results. I wonder does ther registration point of the object determine the coordinate values? Also are the coordinate values local to the clip instance or global to the stage?
[Code]...
View 5 Replies
Dec 27, 2011
I am developing a game for mobile in AIR (as3). I have created some bots for this game that initially just wander around. But when a bonus enters the stage, they have to move to the bonus.The detection of a new bonus and moving of the bots works fine, but there is something wrong with the manipulation when a new bonus enters the stage.Basically, this is how it works (or I try to make it work):My bot moves along with his rotation as a parameter. (works fine)
private function moveToNextLocation():void
{
var angle:Number = _rotation * 0.0174532925; // 1 degree = 0.0174532925 radians
var speedX:Number = Math.sin(angle) * _speed;
[code]....
View 1 Replies
Mar 31, 2010
I have 3 square. smallest square s3 is inside s2. s2 is in side s1. each is 10px larger [code]how can I find the coordinate of child in its parent's coordinate system?
View 1 Replies
Mar 8, 2010
For those of you still with me, I am tasked with making some scrollable content in Flash. Load in a TextFile using LoadURL(), then display it. To get the text, we've written our own class TextFieldExtended, which is basically just there to give the textfile location to the constructor and then have the class do the various steps of getting it and loading it for you.So I needed to get a Scrollbar, which I got hereThe thing is, it works with Sprites.After trying to get it to accept TextFieldExtended, I bumped into a block, since the scrollbar relied heavily on a Sprite property that TextFieldExtended didn't have or could have.
So I tried adding the TextFieldExtended instance to a Sprite instance using addchild.A problem occurs here that I do not know how to handle. It seems that a Rectangle is drawn and the Text is drawn on that. I say this because the scrollbar moves the Rectangle up and down a bit, but the text doesn't scroll, just the Rectangle it is positioned in and the text then moves along with it.My question: can this be fixed, or is does this implementation of scrollbars need a lot of adaptations before this is possible?
View 1 Replies
May 20, 2009
I draw a rectangle i should see a little bold circle to indicate a perfect rectangle, I seemed to lost mine, can somebody please tell me how to get it back!
View 2 Replies
Aug 2, 2011
I am trying to convert a rectangle(actually multiple rectangles) to a curved rectangle. I think it should be pretty easy but I guess i am stupid. Basically I would have a start position and stop position (many of these), and they would be converted to curved rectangles and follow in a cicrle around.
View 0 Replies
Jun 26, 2010
I would like to create a rectangle inside of a rectangle, starting approximately 15% inward from the right side of the other rectangle.
I know how to create rectangles with:
Code:
var newHotRect:MovieClip = new MovieClip();
newHotRect.graphics.beginFill(0x00FF00);
newHotRect.graphics.drawRect(0, 0, 100, 100);
addChild(newHotRect);
But how would I make another rectangle on top of that (the black one pictured) that is approximately 15% from the right?
I toyed around with .right, and .bottomright with no success. Can anyone lead me in the right direction? or even finding the x and y of the upper right or bottom right side of a rectangle?
View 10 Replies
May 20, 2011
how to respond when a rectangle hits another rectangle? I already know how to detect the collision, I just don't know how to respond to it. I'm just trying making a simple side-scrolling platform game where I have platforms I can walk on and bump against on all sides. I have searched everywhere and just can't find the tutorials I'm looking for.
View 6 Replies
May 13, 2009
Iīve made a couple of simple buttons and I have placed a sound on the over frame, when I export the swf the sound sometimes get very distorted and in a browser too, so I made a movieclip "button" instead and attached the sound and the same thing happens!The sound is a mp3, a short "classic" click.
View 2 Replies
Mar 8, 2006
I've got an isometric view of a flat surface. On this surface there are various characters running around and I obviously need to control the depths of each object.
My flat surface needs to be used in two views: top-bottom + isometric.
The original mc is generated in the flat top-bottom mode. For the isometric view, that same mc gets distorted: this way the whole XY coordinates system gets distorted too.
Have a look at this (updated).
So i'd need to create this extra coordinate (is it the classic Z-depth?), and manage to gather information about it...
Does anyone know what the formula would be to calculate the depths of each character (red lines)?
View 2 Replies
May 18, 2002
For some reason, my buttons appear distorted. Not always, but most of the time. Why it that
View 3 Replies
Jul 2, 2010
I recently switched to using a MacBookPro (snowleopard) when developing, after several years of PC use. Now, quite often when publishing my swf:s, embedded sounds get all distorted and filled with loud crackling sounds when running the swf (yes, even on different computers). I tried different compressions, bitrates and qualities with the same result. Something is clearly wrong with how my machine compresses sound.
View 1 Replies
May 31, 2010
I have a grid in a 2D system like the one in the before image where all points A,B,C,D,A',B',C',D' are given (meaning I know the respective x- and y-coordinates).I need to calculate the x- and y-coordinates of A(new), B(new), C(new) and D(new) when the grid is distorted (so that A' is moved to A'(new), B' is moved to B'(new), C' is moved to C'(new) and D' is moved to D'(new)).The distortion happens in a way in which the lines of the grid are each divided into sub-lines of equal length (meaning for example that AB is divided into 5 parts of the equal length |AB|/5 and A(new)B(new) is divided into 5 parts of the equal length |A(new)B(new)|/5).The distortion is done with the DistortImage class of the Sandy 3D Flash engine. (My practical task is to distort an image using this class where the handles are not positioned at the corners of the image like in this demo but somewhere within it).
View 7 Replies
May 28, 2009
I've added the full screen mode to my current project. The only problem is, when I click on the full screen mode the swf becomes full screen but it's stretched out and distorted.
View 3 Replies
Mar 14, 2010
I have a psd that is the background image on a site im creating, when i test the movie it looks fine however when i upload it to the ftp the text looks jagged.
[URL]
If you look on the edges on the cost of love logo you'll see what i mean.
View 1 Replies
Jan 15, 2010
I created a site for a client and they are experiencing something weird with the top links in the base SWF. The links appear to be distorted or doubling up. I don't have anything extra in the MC. And what's worse is that I can't see this effect on any of the computers I have. They see it on their laptop.
I've attached a screenshot from them.
Attachments:
distortedText.jpg
(120.5 K)
View 8 Replies
Jul 12, 2010
I have an mp4 file with the audio sounding perfect that I'm running through Adobe Flash CS3 Video Encoder to convert to an flv which I'm trying to then embed in a fla.My problem comes in the fact that after its embedding when previewing it, the sound quality has -significantly- deteriorated to the point where it sounds crackly and echoing. I've tried changing the sound data rate to maximum, but it makes no difference at all.
View 1 Replies
Feb 28, 2011
I have imported voice-over into my flash animation project as a WAV file. When I test it within the library, it's perfect. When I play it back using "Play" under "Controls" it is slightly degraded. And then when I play it back using "Test Movie in flash professional" under "Control" and when I publish the file, the audio is severely compressed and distorted. Why does this happen and how do I fix it?
View 2 Replies
Feb 5, 2009
I have created a 3d rotation along the timeline inside a movieclip using the 3D rotation tool new to CS4. This movieclip resides inside an swf that will show a number of instances of this movieclip. The 3d tranformation works great when running the swf. BUT! When the swf gets published and I want to load the swf inside a main swf the 3d transformation gets distorted and out of place. Iīve looked at perspective projection and stuff like that, but I canīt figure out how this is effecting a timeline based animation and what I can do to stop it.
View 1 Replies
Jul 14, 2010
Problem: the text inside my movieclip gets distorted when the movie clip is scaled.
Code:
import caurina.transitions.Tweener;
//variables for justMePage
import flash.events.Event;
[code]....
how do i make the text still look good even if the movie clip that it belongs to is scaled?
View 1 Replies
Aug 13, 2010
Got this weird issue going on today. The hitarea, the 'interactive space' of some of my buttons is off/ distorted. I created several buttons in a class with the pen tool and converted them to Buttons. I added some eventlisteners, but when I tested my Movie, I noticed the interactive space of some buttons was gone or at a different position or not the size I made it.
I made another button using the rectangle tool, and tested again. I noticed the visual button was at the place I put it, but the 'interactive space' was at the bottom right. Whenever I would move over this interactive space with my cursor, the visual button would instantly go to the place the interactive space is. Whenever I move the mouse out of the interactive space, the visual button goes back to its inital place.
Check it: (press start, 2 times the right arrow, then the window, then go to one of the buildings in the landscape and click on it)[URL].. Here you see two rectangle shape buttons. Hover over them, no interactivity. Move the mouse somewhat down to the right, and weirdness happens.
[Code]...
View 4 Replies
Jan 30, 2010
I made an SWF file (say X) and I have loaded this SWF file into another FLA file (say Y). With help from this forum, I got to do what I wanted - when I click on a button on the FLA file (Y), the SWF (X) shrinks to a smaller size (about half the size) and when I click on that same button again, X enlarges back to the original size. I acomplished this with tweenlite. THe SWF (X) has a slideshow of images. Now, when the SWF (X) shrinks to a smaller size, the images look very distorted and text in the images are not readable (although the text is large enough to be clearly visible).
View 1 Replies
Mar 21, 2010
I am building a site off of a template and I have a major issue. The site looks fine when previewing it on my computer or in flashBut as soon as it is uploaded it distorts the siteNotice the non-centered tabs and messed up text
View 3 Replies
Apr 15, 2011
I have a couple of Flash projects that were originally built in CS3. Last year I upgraded them to CS5 without trouble. Recently I have upgraded my Macs to Snow Leopard, and when I open both of these FLA files in CS5 on Snow Leopard, some of the fonts are insanely distorted.
View 5 Replies
Aug 21, 2011
I have been working on an animation. I have imported my sounds to the library and streamed them live to the animation. They dont sound as good (muffled and distorted) when I publish the preview (flash or html). They sound fine within flash. When I switched the properties from "stream" to "event" it seemed to work great in the preview. I added a few more sounds and now only the first two mp3 clips sound clear and the rest now sound not so clear. They sound okay but I cant figure out why the rest sound bad? They now all have the exact same settings as the first two..
View 3 Replies
Oct 23, 2005
I have a problem where Flash takes it upon itself to modify the width/height x/y values I set objects (MC's) to, usually by less than a pixel. I don't get that.. and wouldn't that mess some things up like when I'm increasing the size of an mc someodd 300 times its original size, then that 0.2 pixel Flash adds in white space could become 50 pixels. Also, when I change the size of x MC, some other MC's will change their size. I can tell because the other MC's are about 1 pixel apart and when I change x MC that pixel is filled in sort of. I noticed some decrease in these problems when I was using whole numbers and x/y values, but it hasn't stopped it completely. I can give an example swf if necessary.
View 3 Replies
Mar 21, 2010
My first time making anything in flash, so go easy on me. I made a set of navigation buttons for a website I'm building for a friend of mine.
When I make it in Flash, everything looks perfect. When I save it as a movie and run on my computer (in Flash Player 6), it still looks perfect. But when I put it on my website, the "M" in "HOME" gets distorted (on all browsers). See here: [URL]
Using Flash MX, can't afford the upgrade to CS right now!
View 1 Replies