creating animations using transformations

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
Ryne
Party member
Posts: 444
Joined: Fri Jan 29, 2010 11:10 am

creating animations using transformations

Post by Ryne »

Soo. Let's see if I can make you guys understand what I want to do.

Basically, for my characters and enemies, I want:

- to have single images for 8 directions. Down, Up, Left-Down, Right-Down, etc. These images wouldn't be animated ahead of time.
- to create animations using transformations in LOVE.

I want to create an effect kind of like this:

http://dl.dropbox.com/u/60256761/anims/likethis.gif

except smoother, less ugly, for all 8 directions, and using LOVE transformations like scale and rotate.

Ideas? Thank's guys.
@rynesaur
User avatar
verilog
Citizen
Posts: 97
Joined: Thu Nov 03, 2011 3:15 am
Contact:

Re: creating animations using transformations

Post by verilog »

I think that kind of "dynamic" transformations (cropping, translation, skewing) would require pixel-level manipulations, something achievable maybe using ImageData. For a certain, fixed area in your image you would require to copy/get certain pixels, add an x/y offset, for example (a linear transformation, in the simplest case), and them paste them back in a new image. You would need to do this for every frame that composes the entire animation. This is my initial guess, maybe someone more experienced in the area can expand upon this :P
User avatar
slime
Solid Snayke
Posts: 2931
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: creating animations using transformations

Post by slime »

0.8.0 has shear parameters to love.graphics.draw, however I'm not sure if that's enough for what you want.
User avatar
Ryne
Party member
Posts: 444
Joined: Fri Jan 29, 2010 11:10 am

Re: creating animations using transformations

Post by Ryne »

Hmm. I was just wondering if it were possible, and hopefully easy. I suppose not :p

thanks anyway!
@rynesaur
User avatar
Taehl
Dreaming in associative arrays
Posts: 1024
Joined: Mon Jan 11, 2010 5:07 am
Location: CA, USA
Contact:

Re: creating animations using transformations

Post by Taehl »

verilog wrote:cropping, translation, skewing
You mean Quad, love.graphics.translate, and Shear? Though I think you can translate with the right shear matrix (I admit that the math is over my head).
Earliest Love2D supporter who can't Love anymore. Let me disable pixel shaders if I don't use them, dammit!
Lenovo Thinkpad X60 Tablet, built like a tank. But not fancy enough for Love2D 0.10.0+.
User avatar
verilog
Citizen
Posts: 97
Joined: Thu Nov 03, 2011 3:15 am
Contact:

Re: creating animations using transformations

Post by verilog »

Taehl wrote: You mean Quad, love.graphics.translate, and Shear?
Yes! That’s right, applying (convolute) a transformation matrix to a pixel’s position or set of positions. For the shear transformation something like this would do. You can actually apply a set of transformations by combining (multiplying) each transformation matrix, so you can create your own "custom" transformation, for large images (and without hardware co-processing) it would be pretty computive-intensive, though. That shear code you got there uses some fancy math, a 2D transformation would be a little bit simpler. I'm honestly not sure if Ryne's problem would be solvable combing love.graphics.translate/scale/rotate as he would need to operate on each pixel position individually. :?
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 26 guests