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.
Skewing/Shearing and Canvases
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- meganukebmp
- Prole
- Posts: 8
- Joined: Thu Jan 07, 2016 10:38 pm
- Location: Sofia, Bulgaria
Re: Skewing/Shearing and Canvases
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?
- meganukebmp
- Prole
- Posts: 8
- Joined: Thu Jan 07, 2016 10:38 pm
- Location: Sofia, Bulgaria
Re: Skewing/Shearing and Canvases
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.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?
Re: Skewing/Shearing and Canvases
It is not possible to create a perspective effect using shearing. When you shear an image, then parallel lines always stay parallel.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.
Check out my blog on gamedev
- meganukebmp
- Prole
- Posts: 8
- Joined: Thu Jan 07, 2016 10:38 pm
- Location: Sofia, Bulgaria
Re: Skewing/Shearing and Canvases
Is there another way to do it then? Are there any libs that allow me to achieve this?micha wrote:It is not possible to create a perspective effect using shearing. When you shear an image, then parallel lines always stay parallel.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.
- Jasoco
- Inner party member
- Posts: 3726
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: Skewing/Shearing and Canvases
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:meganukebmp wrote:Is there another way to do it then? Are there any libs that allow me to achieve this?micha wrote:It is not possible to create a perspective effect using shearing. When you shear an image, then parallel lines always stay parallel.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.
viewtopic.php?f=3&t=2198&p=174908&hilit ... ry#p174908
It'll probably need tweaking of course.
-
- Party member
- Posts: 730
- Joined: Sat Apr 26, 2014 7:46 pm
Re: Skewing/Shearing and Canvases
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
https://github.com/excessive/love3d
Who is online
Users browsing this forum: Ahrefs [Bot] and 4 guests