John Stimac
John Stimac

Reputation: 5491

How to transform a square to a trapezoid in HTML Canvas?

How can I transform a HTML Canvas from a square to a trapezoid?

For example

 ___ 
|   |
|___|

to
 ___
/___\

Upvotes: 1

Views: 893

Answers (1)

polyhedron
polyhedron

Reputation: 1590

Take a look at the raphael framework. http://raphaeljs.com/

This should help ... although it's not an complete answer. Seems like there's going to be a lot of math going on through a stack of canvas items.

Upvotes: 0

Related Questions