# Can flash transform a square into a trapezoid? (for forced perspective)

• 08-07-2007, 11:25 PM
Alluvian
Can flash transform a square into a trapezoid? (for forced perspective)
I know flash can do skewing, but that preserves the parallels, as does every matrix transformation.

I am looking to do basically a tabletop with some forced perspective so the back side (top) is narrower than the front side (bottom), but I would like the originating movieclip be square since I have a series of square tiles on it.

Not the end of the world if it isn't there, but it would be nice.
• 08-08-2007, 12:01 AM
gparis
why couldn't you simply draw it?

gparis
• 08-08-2007, 01:44 AM
shavingcream
yea i agree with gparis but if you dont want to do that draw it dynamicly
createEmptyMovieClip("line",1)
line.lineStyle(3,0x000000, 100)
line.moveTo(100,100)
line.lineTo(200,100)
if you dont know what i just did ask me
• 08-08-2007, 03:59 AM
cresquin
you can check out sandy and papervision, they are 3d apis that will do this.

http://www.flashsandy.org/
http://blog.papervision3d.org/
• 08-08-2007, 03:35 PM
shavingcream
isn't papervision a store in santa cruz?
• 08-08-2007, 04:15 PM
cresquin
could be... but this isn't that.
• 08-08-2007, 04:25 PM
shavingcream
:) lol
• 08-08-2007, 10:15 PM
Alluvian
Quote:

Originally Posted by gparis
why couldn't you simply draw it?

gparis

The objective is not to make a trapezoid, but to take a square movieclip with thousands of movieclips in it (most _visible=false) and deform that parent movieclip into a trapezoid dynamically not because we want the parentclip deformed, but because we want the children to properly deform relative to each other without way too much math.

The concept works GREAT for scaling, transposing, and skewing, but what forced perspective needs is deformation (the vertical parallels all need to meet at a distant point. Can actionscript do that?
• 08-08-2007, 10:26 PM
shavingcream
what? thousands of movie clips will extremely slow down your computor i dont quite understand what you are trying to do
• 08-08-2007, 11:53 PM
Alluvian
It is a tile engine, for a game, and it handles 100x100 (10,000 movieclips) quite fine actually. You just don't render (set _visible=false to all offscreen tiles) anymore than what is visible at any given time and control how far you can zoom out. Once you cap your zoom out, the only bottleneck to number of invisible movieclips is the ram, and that isn't really an issue at all.

I'll ask in the game section I guess. Figured shape deformation would have fit better in the general actionscript forum. Guess not.
• 08-09-2007, 12:08 AM
shavingcream
yea you would probably get more answers there
• 08-09-2007, 02:04 AM
ugoDesigns
Rather than try to deform a 'square' think of manipulating 2 triangles to form your trapezoid. Can't help you on the maths.. hurts my head.