Page 1 of 1
Skewing/Shearing and Canvases
Posted: Wed Jan 13, 2016 11:49 pm
by meganukebmp
Hey, I'm trying to skew a background with objects that are updating each frame. I thought about drawing them on a canvas and then using graphics.shear on it but the canvas remains static. Is there a way to apply any type of translation effect on multiple objects while still updating them?
Here is a pic of what I am trying to do. Black rectangles have to be able to update. Red is the canvas on which all the objects are being drawn.
Thanks in advance.
Re: Skewing/Shearing and Canvases
Posted: Thu Jan 14, 2016 12:30 am
by s-ol
love.graphics.shear should work with and without canvas'. Are you sure you know how to use it? Or do you experience the bug from the wiki page?
Re: Skewing/Shearing and Canvases
Posted: Thu Jan 14, 2016 8:06 am
by meganukebmp
S0lll0s wrote:love.graphics.shear should work with and without canvas'. Are you sure you know how to use it? Or do you experience the bug from the wiki page?
Nvm what I just said. I fixed the canvas not working. I cant figure out how to use shear to achieve this effect though. Since I cant just skew it vertically from the center. I'm missing something.
Re: Skewing/Shearing and Canvases
Posted: Thu Jan 14, 2016 2:11 pm
by micha
meganukebmp wrote:I cant figure out how to use shear to achieve this effect though. Since I cant just skew it vertically from the center. I'm missing something.
It is not possible to create a perspective effect using shearing. When you shear an image, then parallel lines always stay parallel.
Re: Skewing/Shearing and Canvases
Posted: Thu Jan 14, 2016 2:49 pm
by meganukebmp
micha wrote:meganukebmp wrote:I cant figure out how to use shear to achieve this effect though. Since I cant just skew it vertically from the center. I'm missing something.
It is not possible to create a perspective effect using shearing. When you shear an image, then parallel lines always stay parallel.
Is there another way to do it then? Are there any libs that allow me to achieve this?
Re: Skewing/Shearing and Canvases
Posted: Thu Jan 14, 2016 7:57 pm
by Jasoco
meganukebmp wrote:micha wrote:meganukebmp wrote:I cant figure out how to use shear to achieve this effect though. Since I cant just skew it vertically from the center. I'm missing something.
It is not possible to create a perspective effect using shearing. When you shear an image, then parallel lines always stay parallel.
Is there another way to do it then? Are there any libs that allow me to achieve this?
A user named xXxMoNkEyMaNxXx made one for me once for a project, but it's a bit finicky in some projects depending on how they're made, and has some problems. It's a shader. And 0.10.0 breaks it slightly over the fixed 0.9.x version. But here's a post where a 0.9.1 fix was made by someone:
viewtopic.php?f=3&t=2198&p=174908&hilit ... ry#p174908
It'll probably need tweaking of course.
Re: Skewing/Shearing and Canvases
Posted: Thu Jan 14, 2016 9:08 pm
by bobbyjones
You would be able to do it with love3d I played with a little bit and cpml's mat4 already has perspective in it. I only used the ortho but im sure the perspective would work as expected. I recommend going to their forum and download their demo from the second to last page and use that as a base to mess with. If you have any trouble with it then join irc and talk to holo or karai they made it.
https://github.com/excessive/love3d