ActionScript 3.0 :: Draw Cylinder And Cone Through Flash?
Feb 7, 2011How to draw cylinder and cone through flash action script.
View 1 RepliesHow to draw cylinder and cone through flash action script.
View 1 RepliesI want to create a 3D cylinder, sphere, cone using Actionscript for Flash Player 10. Is there any available class? I also want to know how to paint gradient, wrap text and texture around them. It would be nice if these class have these functions. I can't use non DisplayObject in this project so PV3D is not an option
View 2 RepliesThis should be a bit of simple geometry: How do I calculate the points to draw the lines in the code below so that it makes a 2D cone or wedge shape?
import flash.geom.Point;
//draw circle
var mc=new Sprite()[code]...........
UPDATE:I should have mentioned my aim is not to draw a wedge shape, but to draw a line from a random point to the edge of an existing circle.If you're more comfortable with algebra than actionscript,
I have designed a cylinder shape in flash. The edges of cylinders are coming out and also they are looking blur. But the interesting thing is when I see the cylinder on 300% it is clear and lines are not blurred.
View 3 RepliesI am trying to make my game character(fishes) go to a new generated destination only on what their current cone of vision is able to "see", therefore i have drawn a triangle MC to make it their cone of vision and from there generate random points within the area of the cone, and the code i have used is shown below, and it kept returning the top coords of my stage why is that so? [code]...
View 2 RepliesI have drawings (arrays of points with x and y coordinates) that are rotated in 3d space: [URL]
As it is now, the drawing looks as if wrapped around a cube, with a nasty 90° degree in the corner. Instead it should look as if it were wrapped around a cylinder. Before starting the rotation I call a function (in ActionScript) 'bendDrawing' that for each point sets an initial z-value:
for (var j = 0; j < numPoints; j++ ) {
// drawings are centered - points left of center are < 0
var distFromCenter = Math.abs(shape[i].points[j].x);
[Code]....
i am developing an application where client can add his photos to appear on a sphere or ball or coffee cup and able to save them and give it for printing using flex. like itasveer.com site. i tried to use away3D but if the image is small it is stretched and added to sphere. i dont want it to strech instead the original image shud appear on the sphere. if it is added to cup it shud cover only the circular part it shud not add this to top and bottom.
View 1 RepliesI would like to combine bitmaps to one texture and apply it to a cylindric primitive. The cylinder will be rotating or better: the texture should moving along the cylindric-surface and therefor you should see only one (up to 3 textures at the same time). For better understanding: it's my intention to create somehow a poster-pillow with a undefined number of posters on it. By clicking on the pillow, it should rotate to the next poster but you will see always parts of the previous/next poster.
My question is: How can I load the texture dynamically but also how to combine, load/unload posters on the run ?
I want to create a cylinder, but with different sides (front and back). At the minute I have a mc on the stage and link in that as the material, but it repeats that all over the cylinder?
[Code]...
Basically I need to have;
- interface where a user can choose a font (from pre determined font sets) and input a text string
- This text is then displayed engraved on a ring (jewellery)
I'm not sure the best way to achieve this or if there is a module somewhere that does similar.
My best guess would be to
- using mathematics (sin, cos) to be able to plot the oval (where the text need to be displayed on the ring) on an imaginary graph.
- From here there will be a centre , start and end point. The text will need to be limited as it will eventually following the curve of the ring until it can't be see as it is masked by the angle of the ring
- If using dynamic font then the width of each letter should be possible to obtain with AS.
Then mathematically it should be possible to determine how far away from the centre point on the oval each letter is.
- Following this, dependant on the letters distance from the centre, transformations can be applied to each letter. IE stretch, skew and an emboss filter via the convolution filter.
- Hence this will provide the illusion that the text is following the curve of the ring and the look like it is engraved via the emboss.
I tried with AS2 to animate the movement of a cylinder going non stop up and down and with possibility to change speed. I managed the sliding down and the acceleration of the cylinder but it does not recognize the limit where it has to stop and make the movement backwards to starting position.[code]
View 1 RepliesI am using the draw() method of the BitmapData to encode a jpeg of part of the image. Now this should be easy enough given the object I want to draw to the bitmap is on the stage at design time so I know its location and dimetions exactly! Heres the code I have in place.
Code:
var myBitmapSource:BitmapData = new BitmapData ( street.width, street.height, false, 0x333333);
myBitmapSource.draw(street, null, null, null, new Rectangle( 96, 5, 571, 450 ), true );
I know for a FACT that no part of the street clip I am drawing out is in negative space, and it's registration is (0,0). However, it cuts off A lot of the top of my image. y=5 in the above rectangle is where I need the top to be, but it cuts the top off of the image... even if I change it to 0, it has no effect.
I'm making something that requires me to draw() the youtubeplayer Giving me this pretty error:
[Code]...
I'm trying to do some lean blitting for an object that rotates by rotating it once at startup and capturing a BitmapData snapshot of each 5 degrees. The problem I'm having is that the draw() method of the BitmapData object is only picking up pixels in the MovieClip that are below and to the right of the registration point. If I change the MC so that the registration point is in the top left corner, I sometimes get what looks like most of the pixels, but the entire object rotates into and out of the frame, since it's rotating around the corner and not the center.
View 5 RepliesI need to be able to draw a thick patterend line between 2 points in AS3, I can't use the draw API because it doesn't all me to actually put detail (pattern etc) into the thickness of the line, I thought about perhaps using the line to create a bitmap version and then using that as a mask, but I remember many years ago seeing some examples that use a movieclip as a source for a line.
View 1 RepliesI am having an issue with using BitmapData.draw(stage). I am getting the following error:
SecurityError: Error #2123: Security sandbox violation: BitmapData.draw: file:///C|/Documents%20and%20Settings/bla...bla...bla.swf cannot access null. No policy files granted access. Here is a portion of my code:
var bd:BitmapData = new BitmapData(2800, 2100); bd.draw(stage);//this is where the error happens All of the files referenced (.xml/.jpg/.swf) are located in the same local folder as the main .swf. How do I get around this error? The main objective is to print the stage using PrintJob(). I am using Flash Professional CS5.5 and publishing to Flash 10.0/10.1. Let me know if I need to supply any more info.
i have a class thats create a class with bitmapData that merge 2 IBitmapDrawable. one of them is 24*20 while the other is 16*16.i want to draw the smaller first in a bitmapData object which its width and height are 24*20 but i want to draw it in the center of the big bounds.
[Code]...
Is there a quick way to draw an arrow in Flash? I have seen postings from 2006 which say there isn't, but I wondered if there is a way in CS4?
View 1 RepliesHow to create Draw with Flash ?
View 1 RepliesI'm trying to draw this hint box and was wondering if anyone could explain to me how to draw a curved line like the one below in flash?
View 4 RepliesIn Flash CS4, when I draw a rectangle (or circle, or anything) with a color that has 0 alpha, nothing is drawn. Also, if I select a piece of drawing and change the color to 0 alpha, the drawing (e.g. rectangle) disappears!I know I can draw a non-transparent rectangle, convert it to movie clip and set the movie clip's alpha to 0, but I'd like to avoid this.
View 5 RepliesI have problem when drawing transparent png image on transparent bitmapData.
code of first frame:
stop();import flash.display.Bitmap;import flash.display.BitmapData;import flash.display.BlendMode;import flash.geom.ColorTransform;import flash.geom.Matrix;
var bmd: BitmapData = new BitmapData(500, 400, true, 0);var bitmap: Bitmap = new flash.display.Bitmap(bmd);addChildAt(bitmap, 1);
[Code]...
I'm using Flash Pro 8, and this is my scene right now: For some reason, I can't put anything over the door.I can't draw on it or anything. I can draw on anything else in the room.
View 2 RepliesIs there any simple method to draw a grid? Is it possible to do this by drawing lines?
View 2 RepliesCould I make my own Slider descendant (extends Slider) with thumb and scale drawn by ActionScript only?
View 1 RepliesIs there a drawing library for ActionScript 3? (Pencil, Pen, Eraser tools, etc)
I know that pencil and eraser probably aren't too complicated, but I don't want to roll my own pen tool if one exists.
Does anyone knows how to draw 3D Bezier in actionscript 3 flash 10?
View 3 RepliesI need to take a vector image I was given and add it to an animation whereby it appears as if the swash was drawn from left to right under a word.
Best I can do so far is make it appear under the word, but this isn't what has been asked for.
How to draw something over a video in Flash? We can use any version of AS and any other programming language.
View 2 Replieshow to draw a soundwave in flash like in this example:
[URL]
also, I would like to know does the sound needs to be fully loaded before doing that or it could be done on the fly while the sound is loading?