Lazrhog

Just as a quick test, I threw the dragon textures into TexturePacker, added the dragon-skeleton.json file, the TexturePacker plist and png files to the xcode project, and bam. nice :). Time for the Animation stuff.

Avatar
Lazrhog

Kickstarter Backer
  • Postovi: 70

authbattledamage

I love messy! You should see my office. If you could share the placement parts that would be great! Awesome job!
authbattledamage

Kickstarter Backer
  • Postovi: 70

terrymisu

Lazrhog je napisao/la:Rather than drawing at the world coordinates, offset by the Skin offsets. The skin offsets need to be multiplied by the last matrix of the bone they are attached to, before being added to the Bones world coordinate. Hope that makes sense :)
Can you give an example?
Avatar
terrymisu

Kickstarter Backer
  • Postovi: 136

Lazrhog

well my render code (in obj-c) looks like this, which shows how I apply the skin transformation using the bone matrix
-(void) draw:(float) globX :(float) globY :(float) globZ
{

for (int i = 0, n = [drawOrder count]; i < n; i++) {
Slot *slot=[drawOrder objectAtIndex:i];

if (slot->attachment) {
// calculate x and y
float locworldX = slot->attachment->x * slot->bone->m00 + slot->attachment->y * slot->bone->m01;
float locworldY = slot->attachment->x * slot->bone->m10 + slot->attachment->y * slot->bone->m11;
locworldX+=slot->bone->worldX;
locworldY+=slot->bone->worldY;

// draw the attachment at this slot
[slot->attachment->attachmentAtlas drawTextureAtPoint:
(locworldX/2.0) + globX : /* x */
(locworldY/2.0) + globY : /* y */
globZ : /* z */
slot->bone->worldRotation+slot->attachment->rotation :
slot->attachment->texAtlasIndex :
false];
}
}
}
(oh, I haven't worked out what the /2.0 is for yet on the x and y, but it might be to do with retina display rendering, so you may not need that)
Avatar
Lazrhog

Kickstarter Backer
  • Postovi: 70

terrymisu

What are globX and globY?
Avatar
terrymisu

Kickstarter Backer
  • Postovi: 136

Lazrhog

They are just so I can position the character anywhere on the screen
Avatar
Lazrhog

Kickstarter Backer
  • Postovi: 70

Lazrhog

Well animation has begun. Not quite right yet though (note this is using a fixed animation time step so I could see it slowed down a bit)

http://www.youtube.com/watch?v=uaAfx6Polfk

So my slots aren't changing images (if you look at the wings)
Avatar
Lazrhog

Kickstarter Backer
  • Postovi: 70

authbattledamage

Are you using the spine-cpp runtime? Or your own cpp?

I see your using a pointer dereference.
authbattledamage

Kickstarter Backer
  • Postovi: 70

Lazrhog

authbattledamage je napisao/la:Are you using the spine-cpp runtime? Or your own cpp?

I see your using a pointer dereference.
I have basically completed ported the spine-cpp into objective-c and integrated it with Texture Packer and OpenGL2.0. There is no c++ in my project
Avatar
Lazrhog

Kickstarter Backer
  • Postovi: 70

Lazrhog

Ahh cool. I found the Slot bug. Dragon wings now animating :)

http://www.youtube.com/watch?v=Ubsh24uW6_4

I will upload a better video tomorrow and see if I can get a few more things going at once to see how fast it is
Avatar
Lazrhog

Kickstarter Backer
  • Postovi: 70

authbattledamage

Awesome job!
Wondering if you could share your progress via github! I have been working through some it and things are not perfect yet.

Thanks for sharing!
authbattledamage

Kickstarter Backer
  • Postovi: 70

Lazrhog

Not ready to share yet as nowhere near tested enough and also supremely drunk :). Gotta live too ;)
Avatar
Lazrhog

Kickstarter Backer
  • Postovi: 70

Lazrhog

OK, so today I coded up the animation mixer, and worked out how to do all the scaling and positioning properly. Had some fun and made a 100 spineboys :)

http://www.youtube.com/watch?v=mFWGbSQDeTM&hd=1
Avatar
Lazrhog

Kickstarter Backer
  • Postovi: 70

Lazrhog

Noticed that the smaller scaled versions of spineBoy in my demo are not very well drawn by openGL. I enabled Mip-Mapping and now they look great. However, it did hit the framerate a bit. On the iMac at least, I had to reduce to 75 spineBoys to keep at 60fps. 75 ran fine on an iPhone4, so it maybe the iMac is limited a bit. I will try more on the iPhone later. Also doing a better high quality video later, because it really does look very cool :) Also testing the Goblins later, as that will test out the skin changing part of my runtime.

I also noticed that I had to invert the rotation direction of the images out of the runtime when I flipped in the x-direction. I double checked my implementation and it seemed fine. Has anyone else noticed this, or do I have another bug to hunt down ?
Avatar
Lazrhog

Kickstarter Backer
  • Postovi: 70

Chounard

I had the same problem because I was applying my rotation matrices out of order. I flip horizontally by doing negative scale on the X axis. Correct order for my framework was finalTransform = translation * rotation * scale, but I had scale and rotation transposed.
Avatar
Chounard

Kickstarter Backer
  • Postovi: 50

Lazrhog

Well, a bunch more stuff working tonight. A few more bugs. Took a super high res video with my good camera but can't find the cable. Will upload that tomorrow. This looks sweet !

http://www.youtube.com/watch?v=qwSvNzj_3g4
Avatar
Lazrhog

Kickstarter Backer
  • Postovi: 70

Chounard

If your Mac is fast enough, you can use the built in Quicktime screen recorder. Works okay for me.
Avatar
Chounard

Kickstarter Backer
  • Postovi: 50

Lazrhog

Oh thats cool. Never knew it could do that lol

Nice pretty High Resolution video of my iPhone Spine Demo !

http://www.youtube.com/watch?v=CSaWnop2bgQ&hd=1
Avatar
Lazrhog

Kickstarter Backer
  • Postovi: 70

renderplace

Looks very nice! Congrats.

I suggest to start another Kickstarter project, count on me :)

Any chance you might want to share working demo with cocos2d community?
renderplace
  • Postovi: 3

Lazrhog

renderplace je napisao/la:Looks very nice! Congrats.

I suggest to start another Kickstarter project, count on me :)

Any chance you might want to share working demo with cocos2d community?
This isn't using cocos-2D, and I think Nate is doing a specific Cocos-2D runtime, and there is already a 'hacked' version running in another thread I think. I am fairly sure I will release my source when I'm finished. Just not finished !
Avatar
Lazrhog

Kickstarter Backer
  • Postovi: 70


Natrag na Editor