Hi,
You can "cheat" with cylinders.
I did a similar kind experiment in AS1 a long time ago with
something similar, but did not draw the lines between shapes.
You are welcome to look at the code - it is fairly object oriented,
but may need some tweaking - take a look at the Spherus actionscript in
the FLA if you want to. My code will draw planes along an axis, in one
of 2 ways - a spherical or pyramidal pattern. This idea could be
adapted to draw 2 planes on an axis and rotate the axis using the
controls - these maybe a bit funky and different, but look at the things
the 3 controls of the shape affect the drawn thing...
http://glenpike.co.uk/play/fiolin.html
Basically you can draw 2 circles on an imaginary axis and you can
rotate that axis about... ...which is as far as I got - look at the
"update" function.
Then if you can work out the width of the circles, you can draw a
line between corresponding 2 points... ...you would need to calculate
the position of the line start by using trigonmetry...
so to find an x,y point on the edge of a circle - you know the
radius of the circle and you know the angle which relates to the
position of the point on the circle.
Once you have got the position of x & y, you can translate that to
the 2nd circle by adding the vector represented by the axis, or by
repeating the same calculation with the second circle.
Do the same for the second line and then draw the lines.
I hope this is helpful. If the code is confusing, just look at
using SOH TOA CAH to work out your x,y positions...
Glen
Pedro Kostelec wrote:
I believe perpervision should do the work but i am too lazy to learn using
it, i think i'll try flashsany if i don't find out how to do it myself.
If anyone know how to code it please help a bit. I love maths, but i can't
figure out how to code it
Thanks
On Sun, Apr 27, 2008 at 1:50 AM, ekameleon <[EMAIL PROTECTED]> wrote:
Hello :)
For me the best way to draw a cylinder is a realtime 3D engine like :
http://code.google.com/p/papervision3d/
http://blog.papervision3d.org/
or
http://www.flashsandy.org/
or others....
EKA+ :)
2008/4/27 Pedro Kostelec <[EMAIL PROTECTED]>:
Hi
I am trying to draw a tube/cylinder with as3.
What i am trying to do is draw 2 circles in different places and then
findind some points in the circl'es outline and joining and coloring the
new
created shapes. My question is How can i find those points in the
cilcles
outline?How should be the loop? Or is there a better way of drawing a
tube?I
need it to be in as, because i need to make on of those "circles"
draggable
and the tube shoud be redrawn on every frame again.
Is my question clear?
Thanks
--
Pedro D.K.
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
--
Glen Pike
01326 218440
www.glenpike.co.uk <http://www.glenpike.co.uk>
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders