• Editor
  • My own runtime progress (iOS)

Related Discussions
...

This is where I got and haven't moved any more.

  • 編集済み

Ahhh, there you are SpineBoy. Welcome to the world

HTTPS をサポートしていないため、画像は非表示になっています。 | まだ表示する

HTTPS をサポートしていないため、画像は非表示になっています。 | まだ表示する

Hmm, a few aliasing issues to sort out first I think (edit: sorted)

Nice, what was it that you fixed?

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 🙂

It does. I am going to try that later with my project I have testing this.

Thanks!

authbattledamage wrote

It does. I am going to try that later with my project I have testing this.

Thanks!

No probs 🙂 I'd throw the source up, but its a bit messy right now lol

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.

HTTPS をサポートしていないため、画像は非表示になっています。 | まだ表示する

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

Lazrhog wrote

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?

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)

What are globX and globY?

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

  • 編集済み

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)

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

I see your using a pointer dereference.

authbattledamage wrote

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

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

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!

Not ready to share yet as nowhere near tested enough and also supremely drunk 🙂. Gotta live too 😉

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 ?