资源介绍
透视网格
在画布上的两点透视网格。
安装
npm install perspective-grid
用法
import PerspectiveGrid from "perspective-grid" ;
import canvasContext from "canvas-context" ;
const { context , canvas } = canvasContext ( "2d" , {
width : window . innerWidth ,
height : window . innerHeight ,
} ) ;
const grid = new PerspectiveGrid ( context , 10 ) ;
grid . init (
new Point ( 300 , 380 ) ,
new Point ( canvas . width - 3