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.
creating animations using transformations
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: creating animations using transformations
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
- slime
- Solid Snayke
- Posts: 3166
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: creating animations using transformations
0.8.0 has shear parameters to love.graphics.draw, however I'm not sure if that's enough for what you want.
Re: creating animations using transformations
Hmm. I was just wondering if it were possible, and hopefully easy. I suppose not :p
thanks anyway!
thanks anyway!
@rynesaur
- Taehl
- Dreaming in associative arrays
- Posts: 1025
- Joined: Mon Jan 11, 2010 5:07 am
- Location: CA, USA
- Contact:
Re: creating animations using transformations
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).verilog wrote:cropping, translation, skewing
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+.
Lenovo Thinkpad X60 Tablet, built like a tank. But not fancy enough for Love2D 0.10.0+.
Re: creating animations using transformations
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.
Who is online
Users browsing this forum: Bing [Bot], Google [Bot] and 4 guests