ActionScript 3.0 :: Rotate An Image In 3D Space?
Jun 28, 2010
I have an image that I want to rotate in 3D space when you move the mouse. This seems easy enough, and I have it mostly working. The problem is, it seems like Flash's 3D camera isn't oriented towards the image. The image is inside a MovieClip so that the center of the image is at 0,0 in the MovieClip, and the MovieClip is located at stageWidth/2,stageHeight/2 -- so it's in the centre of the stage. But if you move the image backwards in z-space, the image doesn't look like it's scaling down, which is what you'd expect -- since it's moving away from the camera -- but instead, it moves up and to the left as it moves backwards.
This is my code:
package {
import flash.display.*;
import flash.events.*;
[Code]....
Does anyone know why the camera isn't oriented towards stageWidth/2,stageHeight/2? How do I make the image move directly away from the camera in z-space? Or am I just stupid for not giving up and trying to learn PaperVision?
View 8 Replies
Similar Posts:
May 21, 2010
I'm using Flash CS4 and AS3 and trying to get this cube to look as though it's actually in 3D space. [URL]. I know that because it's really two dimensional I'm dealing with the panels being on set layers and I need them to dynamically figure out what panel should be brought to the front. I don't really even know how to tackle this... Is there code I can use to get it to constantly check what should be on top? How would it even test this?
View 5 Replies
May 19, 2009
So far my logic seems fine for half of the experiment, however, not the other half:[URL] What I'm trying to accomplish is when a user holds down the mouse and drags it across the stage the movie clip will rotate in 3D space horizontally. That works, however, when the mouse is released the movie continues to rotate along with the mouse position. When the movie clip is clicked again then it will stop rotating, but it cannot be clicked and dragged a second time. The link above explains it the best. Also I want to make it so the movie will start to rotate when the mouse is down anywhere on the stage and not just the mc itself.
[CODE]....
View 6 Replies
Oct 24, 2011
i want to rotate 3D an Image called img1 in Flex. I want to rotate it around y axis 180 degree. I can do this by using 3D effect already built in Flex but i want to do a bit more different. I want during rotating, there's another image called img2 appear on back of img1 (in default case, the image appear on the back is img1) and when rotating finish, the image will be img2.
View 2 Replies
Mar 28, 2011
I have an image that doesn't fill the <mx:Image> tag because it's not the exact dimensions (it is too short) and I have maintainAspectRatio set to true:
<mx:Image id="theImage"
source="{data.photo_thumb}"
horizontalCenter="0"[code]....
The <mx:Image> tag has a fixed width and height (it's 100% of the tile size--this is in an ItemRenderer). How do I get the image to sit on the bottom of the <mx:Image> tag?
View 2 Replies
Apr 19, 2011
I have rotated an image around 0,0 using the code below. I need the new coordinates of the corners of the rotated image.
bitmap.rotation=_angle;
UPDATE: if i rotate an image 10 deg then that moves an image 10 deg clockwise from 0,0
the bottom left corner was 0,20 and so i need to change the point (0,20) 10 deg clockwise using trig?
View 1 Replies
Aug 29, 2011
When insert an image into TLF in flex3, I found that image in TLF is displayed in a square area. so there is some space at the top of the image. See the attached image for this problem. How to remove this space? I try the following method, But it doesn't work!
[Code]....
View 1 Replies
Jul 2, 2009
I have a row of images that are loaded in next to each other in one long row. When the images have been loaded in, a saturation filter is applied to them. When this saturation filter is applied, a gap appears between some of the images? (the background is yellow, so a yellow gap appears).
View 5 Replies
Apr 9, 2004
I am designing an image gallery to show project screenshots for a portfolio. The horizontally scrolling screenshots technique is nice, but I want to do something similar in 3D space.
When the user clicks on the screenshot buttons for the selected project, I want the appropriate image to rotate around an imaginary center, increase in scale, and fade in to full opacity.
At the same time, the other images need to rotate around the same center point and scale down while the alpha decreases. The Screenshot furthest away from the viewer would have the smallest size and lowest alpha setting. Here's a couple things that might throw a wrench into the works. I need to keep all the images facing forward (instead of rotating as if they were on a cyllinder). Also, not all of my projects have the same number of screenshots. Can I do all this with actionscript?
View 5 Replies
Apr 9, 2004
I am designing an image gallery to show project screenshots for a portfolio.The horizontally scrolling screenshots technique is nice, but I want to do something similar in 3D space.When the user clicks on the screenshot buttons for the selected project, I want the appropriate image to rotate around an imaginary center, increase in scale, and fade in to full opacity.At the same time, the other images need to rotate around the same center point and scale down while the alpha decreases. The Screenshot furthest away from the viewer would have the smallest size and lowest alpha setting. Here's a couple things that might throw a wrench into the works. I need to keep all the images facing forward (instead of rotating as if they were on a cyllinder). Also, not all of my projects have the same number of screenshots. Can I do all this with actionscript?
View 5 Replies
Jul 2, 2010
I'm a Web designer from London and although I have good Photoshop skills, I can't put together my designs for animation
Description:
I would like to know how I can make an image invisible until I hover the mouse over it. Once the image becomes visible how can I make an image behind it (on a different layer) rotate until I move the mouse away.
1. How do I make image invisible until I hover mouse over it?
2. Once image is displayed how do I make an image rotate 90 degrees behind it?
3. Once I move the mouse off, how do I make the button become invisible again, and the rotated image to be restored to it's original rotation.
I am using Flash / Photoshop (CS5)
View 2 Replies
Apr 21, 2011
In actionscript 3.I have an image which rotates an amount _angle.Then I want to move that image in the _angle direction. The angles below are the same but it moves in some odd direction.I have already tried -_angle and also 360-_angle. If I rotate an image 45 deg clockwise then i want it it move in the 45 clockwise direction img1.rotation=_angle; _y-=(speedfire*Math.sin(_angle*(Math.PI/180)));_x+=(speedfire*Math.cos(_angle*(Math.PI/180))); BTW the image is moving from top to down the screen down like a missile.
View 3 Replies
Dec 30, 2008
How or where I could find the code to rotate an image or a movie clip just using code. I use MCtween to move them on the X and Y but I don't know how or even if you can rotate with that add on. I don't need it to be a smooth animation I just need it to turn on its side when a btn is clicked.
View 5 Replies
Jul 10, 2011
I want to rotate an image continuously on page load. Code works fine for 1 rotation on page load but to achieve the same effect continuously I have included the .play() statement in an infinite while loop as shown below. But it causes the page to hang and nothing shows up.
[Code]...
View 3 Replies
Jun 2, 2009
I'm doing a mini app in AS2 where the user can upload an image into Flash and be able to crop, scale, and rotate and image, and after they're done, save the edited image to the server.I know I have to load an image into the BitmapData, after that I'm lost.
View 1 Replies
Aug 24, 2009
I'm doing a mini app in AS2 where the user can upload an image into Flash and be able to crop, scale, and rotate and image, and after they're done, save the edited image to the server.I know I have to load an image into the BitmapData, after that I'm lost.
View 10 Replies
Aug 25, 2010
Okay so I have two import pieces of code involved in this. This first tiny bit is what creates an object called OBJECT_arrow. It is located in the main function of my main class[code]...
It isn't really all that important. Now this next bit is the OBJECT_arrow class. What it does is loads an external png image and draws it. [code]...
View 2 Replies
Oct 5, 2010
I'm trying to animate (rotate) an image in flex4 but it seems that flex is adding easing to my animation by default. How can I over ride this so my rotate doesn't have any easing. Here the line of code I'm using
[Code]...
View 1 Replies
Mar 22, 2007
Jeez how hard can this be? I am giving up for now, but perhaps one of you can tell me why I can't simply load an image into flash and rotate it using AS...[note: image is 700x700 pixels in size]Oh it loads all right, but it will not rotate around its center. I know it loads the image in at the top left corner, but I thought the following code would fixt that:
Code:
this.createEmptyMovieClip("george", 0);
george._x = 0;
[code].....
View 1 Replies
Apr 13, 2011
I am having problems with adding images to a cube. I like to have a specific image on the bottom and when turned show the image
Code:
bmp = new BitmapFileMaterial("../lib/logo.jpg");
bmp.smooth = true;
matListBmp = new MaterialsList({
[Code]....
View 1 Replies
Dec 12, 2010
I am writing a program that need to load photos. However, there is limitation in flex that users cannot load photos with pixel above 4069 x 4069 into a bitmapdata. How can I check photos pixel before running to error? Since some pictures are big nowadays, I would like to check the user's system memory and free harddisk space. See if the computer have enough space to load the photos.
View 5 Replies
Feb 15, 2011
Basically I would like to tween a retangular 2D image on the stage, but also make it look like it is wrapping round on itself.A visual example of the effect I mean is here: [URL]Imagine the above is a rectangular shape being tweened from Right to Left, but when it reaches the left it wraps round as in the picture.Is this possible with Flash CS4 & AS3 or does it require some special add-on?
View 0 Replies
May 3, 2011
I am trying to use rotationY,X,Z on an externally loaded image. The image is displayed properly when no 3D rotation is applied, but does not appear afterwards. I have tried various things: loading the image into a bitmap, loading that bitmap into a Sprite/MC. What am I missing?Just to be sure, regular rotation works fine, e.g
PHP Code:
pic.rotation = 2;
....axis rotation does not
[code].....
View 1 Replies
Jan 24, 2010
How can I rotate an Image eg. 180 degrees clockwise using the Matrix. I can use the following code to rotate the image 90 degrees, but it is incremental, meaing
var matrix:Matrix = new Matrix();
matrix.rotate(Math.PI/2);
matrix.tx = imgControl.content.height;
var bitmapData:BitmapData = new BitmapData(imgControl.content.height, imgControl.content.width);
bitmapData.draw(imgControl.content, matrix);
imgControl.source = new Bitmap( bitmapData);
[Code]...
View 1 Replies
Jan 5, 2012
I am trying to rotate a image using rotationY but it always rotates based off of the left side of the image is there a way to change the rotation point to be the center of the image? Is seems like you should be able to use the transformAround() method but I am having problems finding a example of the transformAround that has to do with images. Does anyone have any examples of how do this or am a going about this the wrong way? What i am trying to do is build a slide show that rotates around and you tap on the images to enlarge.
View 1 Replies
Apr 15, 2007
I am updating source code I came across to AS 2.0 and I am having problems with the tweens. Here is what I am trying to accomplish in AS2.0:[URL] Here is the part of my updated code I am having problems with:
[Code]...
This is my problem: (1) I want the top image to tween to the right and up in X and Y direction and also slightly rotate. THEN I want it to tween back underneath the other stack of pictures in center of swf. However what is happening is that the depth of the topimage is being set under all the pics right away and the tween takes place under all the pics and not ontop. Is there a way for me to wait until the tweens are done and then execute my swapDepths line? Here are problem lines in detail:
[Code]...
View 1 Replies
Dec 11, 2009
I have necessity to create an animation similar to this [URL].., give the possibility to the user, to rotate a 3d image.Is possible with Flash?
View 2 Replies
Jul 6, 2011
I'm trying to apply a GlowFilter (border) to a image and then rotate+skew it. Unfortunately, doing this makes the filter look bad (jagged edges) even though the image itself is smooth. I've tried a few things, including using different filters (like the DropShadowFilter). Here's a rough example of what I'm doing...
[Code]...
View 3 Replies
Mar 30, 2011
The idea is I have 3x3 containers(Sprites) - each one holds 2 tiles of 2 two images (shown one and unvisible - laying behind) . So there are 9containers and 18 tiles. When I click on the image I get rotation of the containers, and when every container is about 90 degrees, its childs swap each oher. So in result I get second image shown. But unfortunely then, shown image is rotated by 180 degrees, that means its left side is on the right. Pre rotating containers ( of tiles gives total mess, as middle tiles seem to be right, but left side of the image and right doesnt match to rest.So I need to rotate tiles, which are bitmapData - parts of Bitmap. But I can not rotate them - there is no property .rotationY for bitmapData, and I can not use matrix's rotate() method as it traits only angle rotation and not axis rotation.If I rotate by Y axis the bitmap before slicing it to tiles nothing happens, so I guess draw method relies on default Bitmap.
So Q : How can I rotate on Y axis a bitmap to have mirror reflection of the image and then apply it reflected to the as a .bitmapData property and slice it to small pieces.
View 0 Replies
Dec 13, 2010
i am writing a program that need to load photoshowever, there is limitation in flex that users cannot load photos with pixel above 4069 x 4069 into a bitmapdata.how can i check photos pixel before running to error? since some pictures are big nowadays, i would llike to check the user`s system memory and free harddisk space. See if the computer have enough space to load the photos.
View 2 Replies