Jump to content

jeremyjh

Members
  • Posts

    6
  • Joined

  • Last visited

Posts posted by jeremyjh

  1. 9 hours ago, lucid said:

    That's odd.  When you reverse the sign in render, you're reversing the sign of y after all bone transformations have taken place?  If so, I might need to change the reverse y to do that instead of reversing y on load, since that would affect the pre-transformed values now that you mention it.

    Yes if the transformation code implicitly assumes an inverted Y axis. I can't quite think why it would matter. But that seems to be what is happening.

  2. 7 hours ago, lucid said:

     

    @jeremyjh Does it have no effect at all, or just not the desired effect?  If it has no effect, make sure you're setting those values before you initialize the SpriterModel object as it reverses the values upon loading.

    I played with it some more. The pivot setting actually does work as expected and I can remove my manipulation. But I get very jumbled output when I change the reverseYOnLoad to false. I do not simply see signs are reversed; I inserted some debug code and I get very different values for y when I change this to false. 

    These are some values from the first frame when it is true:

    Quote

    Resources/GreyGuy/arms/p_arm_idle_a.png, y:-131.465888
    Resources/GreyGuy/arms/p_forarm_walk_a.png, y:-107.752874
    Resources/GreyGuy/hands/p_hand_a.png, y:-85.028443
    Resources/GreyGuy/legs/p_thigh_a.png, y:-63.344628
    Resources/GreyGuy/legs/p_leg_a.png, y:-44.117789

    And when it is false:

    Quote

    Resources/GreyGuy/arms/p_arm_idle_a.png, y:-47.570174
    Resources/GreyGuy/arms/p_forarm_walk_a.png, y:-27.821273
    Resources/GreyGuy/hands/p_hand_a.png, y:-4.113247
    Resources/GreyGuy/legs/p_thigh_a.png, y:13.048759
    Resources/GreyGuy/legs/p_leg_a.png, y:35.245458

    The animation only looks correct if I set it to true and then reverse the sign in render.

  3. I was also not able to get these settings to work, Cocos2d-X also does not call for Y inverted, regardless of how I set those global variables I have to have code like the following to invert the y position and revert the y position on the (Pivot):

     

            sprite->setPosition(float(spriteInfo->getPosition().x), -float(spriteInfo->getPosition().y));
            sprite->setAnchorPoint(cc::Vec2(float(spriteInfo->getPivot().x), 1.0f - float(spriteInfo->getPivot().y)));

     

  4. I've started an integration of SpriterPlusPlus into Cocos2d-X, a new library called Spriter2dX. It does not yet have much platform support (only tested with CMake for Linux) but I will be adding that as I finish integrating this into the game I am developing. I expect to have Android done very soon, other platforms may follow and of course I'll take pull requests for them.

    I found this pretty easy to do, I think SpriterPlusPlus has a pretty good design for extension points. Cocos2d-X has a very different rendering system than for example SFML - so the ImageFile override had to work considerably differently. In Cocos2dX we don't just render a sprite to the screen, instead each object on the screen has a persistent object in a scene graph which will get rendered in a batch. So to work in the SpriterPlusPlus model I have each CCImageFile manage a pool of cocos2d::Sprite objects that it will position for a single tick. I have an example where I ported shamelessly robbed SpriterPlusPlus's example and its able to run 100 Grey Guy animations at about 50 fps on my laptop, haven't tried it with a real GPU.

×
×
  • Create New...