*You need a GPU that supports pixel effects.
After hours of thinking and math, here's what everyone's been waiting for!
Code: Select all
local texture=require'Perspective' function love.draw() texture.quad(image,vertex1,vertex2,vertex3,vertex4) end
-Fixed image being rotated one quarter turn ccw.
-Added parallel edge support.
-If image is nil, no image will be drawn.
-If only the vertices are given (e.g. texture.quad(v1,v2,v3,v4) ) the function will behave properly.
-Added tiled textures, see Demo's source code.
-Fixed repeat options to work like expected
-Many small tweaks
-Assume edges are parallel if it's close, otherwise the math would degrade.
-Clear effect after writing image
-Change scaling to image-based instead of polygon-based (More intuitive)
-Does not display properly when using love's built in push and pop stuffs.
I'm so excited to see what people will make with this!
Also, please tell me what I should do so you can be comfortable using it straight out of the box.
Controls for Demo:
Click and drag the corners of the image.