Jump to content

PatS

Members
  • Posts

    13
  • Joined

  • Last visited

Everything posted by PatS

  1. Hi Lucid We have committed to using Spriter in our game and will work our schedule around yours (we have plenty of non-spriter related tasks, so no rush, take as long as you need). Can you tell us if all of the Pro features that are listed on the web site will be included in the next release? Regards -Pat
  2. Aha! I was setting the screen position in the root bone's parent, so when the value was calculated it's screen position was set Changing that to set the root bone's parent to 0,0 and applying your code before rendering and the flip works. Thank you very much! -Pat
  3. Didn't work for me. Are you using grim's code to up to that point? When I try it, the object is off the screen. If I calculate x = 200, scale_x = 1, angle = 90, the result is -200, -1, and -90 -200 is off the screen For the angle would it be better to subtract the angle from 360 so 90 would be 270? In any case since it clearly works for you, the data that you are manipulating at this point must be different than the data that I have. Can you verify that the code that you posted is correct? Thanks -Pat
  4. Looking my implementation, I don't use many arrays or vectors. For example my 'object' has a pointer to it's bone, the next and previous object in the current keyframe and a pointer to the corresponding object in the next keyframe. All of this is setup as the 'animation' is initialized and eliminates the need for any lookups I can't say this is faster than having arrays but I do know not looking up an object in an array is always faster than looking one up (even if it's indexed). :) Keep me posted on you flipping code so I can copy it Thanks -Pat
  5. First I tried reversing and then subtracting in 2 different attempts :) Jonny, I think your code is great, and cannot cite anything specific. With that said, my personal preference is not to use STL in game code. For me that is the biggest 'red flag'. I am a real C bigot, so like I said don't take offense, your code is great, I gained a lot of insight from it and it is something that you should be proud of. I could never have written code renders SCML from scratch myself. -Pat
  6. So I have been experimenting with this today find that setting the X Scale to -1 does not work To rule out my code, I made the following change to SCMLpp.cpp line 2483 Transform base_transform(x, y, angle, -scale_x, scale_y); I also tried Transform base_transform(x, y, angle, scale_x, -scale_y); When I tried Transform base_transform(x, y, angle, -scale_x, -scale_y); It worked! but rarely do we need to flip X and Y. I have implemented bones, but I also tried reversing all of the angles and subtracting them from 360 as you suggest without success. Lucid do you have plans for creating something like Jonny's C++ plugin but at a lower level (like C) and tuned for performance? (no disrespect Jonny) I have been avoiding Jonny's code because it is a bit 'heavy' for the platforms that I target. I am asking because if it is in the plan, I see no reason to re-invent the wheel Thanks all -Pat
  7. C2tP and Grim Thanks for your replies. If I understand your suggestions correctly, each sprite in the animation would be flipped in place. It seems to me that this approach would only work if the sprites in the animation were symmetrical (i.e.the left and right sides were the same). We also need to consider movement, the movement of the right arm would have to be transferred to the left when the character was flipped. Grim, I have looked at your very nice C++ implementation and notice that you do not offer flipping as an option. Have you tried? Lucid, are you watching? Can you offer an advice? Did you design it so that the animation could be efficiently flipped in a game? Regards, -Pat
  8. I have my SCML loader and renderer working and can do most anything I need to (scale, move, rotate about the Z axis), except flip the image such that a character that was drawn facing right is now facing left. I have tried adding a rotate Y 180 degrees operation to the transformation matrix but that did not work. Can someone who has figured this out tell me how to do this? TIA -Pat
  9. Of course why repeat the calc for every object and bone. Much better. Looks like I have the update working now I am on to the rendering As always, thanks for your help! -Pat
  10. To clarify, when spin=0, you simply interpolate the angle, otherwise the logic in the GettingStarted doc (pg 7) applies. Correct?. For the bones, I ended up storing an array of pointers to the bone coords with each object in a keyframe. I build the array by traversing the bones from the object's parent back. When I update the object during playback I simply traverse the object's bone array from bottom to top. To illustrate: Lets say that the bone hierarchy looks like this Torso / | \ Head Arm Leg | | Hand Foot The keyframe has an array of bones Torso Head Arm Hand Leg Foot The Foot object has an array of bones: Foot Leg Torso When I update the foot, I process the it's bone array in reverse order (Torso, Leg, and Foot). If understand what you are suggesting, the bone structure will have it's coords and pointer to it's parent. I had starting with a similar approach, where the bones form a linked list that you follow until there is no parent, however, I did not see an easy /eloquent why to process the bones from the top down. One more comment, the field named scale thew me off, I assumed the it was describing the size of the object. One more question, how do I interpret the pivot point in the object? Do I covert it to pixels by multiplying it by the object sprites height and width? Thanks very much for your help -Pat
  11. I think I have it. Does this pseudo code look correct? Save the position, angle, and scale from the root of the hierarchy (they are parentPosition, parentAngle, and parentScale) Loop for the remaining hierarchy entries a) Calc the bones position by interpolating this object's position with the corresponding object in the next key frame b) Multiply the resulting X and Y values by the interpolated scale X and Y c) Calc the newPosition rotate_point(bone.pos, parentAngle, parentPosition) /* these are used for the next item. */ d) Calc the parentPosition by interpolating this object's position with the corresponding object in the next key frame e) Calc the parentAngle by interpolating this object's angle with the corresponding object in the next key frame Loop The object is drawn with it's upper left corner at the final new position, rotated by the final parentAngle at the object's pivot point. So if the object's bone hierarchy as 2 entries, I would process the object's parent's parent, then the object's parent and finally the object. The key frame has 10 bones, only those two that are direcly related to object are processed. One more question, if the SCML file has spin=0, should the spin be treated as -1 or 1? Thanks -Pat
  12. I am trying write code that will consume, animate, and render an animation from a SCML file. What I do not seem to grasp is how to apply the bones attributes to the objects. There is one plug in that handles bones, but I do not have a computer that it will run on so I cannot get very far when I try to dissect the logic. Is it possible to get pseudo code that describes how to do this Thanks, -Pat
  13. Hi Before I ask a bunch of questions about bones, can you tell me when you expect to publish a revised Getting Started With SCML Guide? Regards -Pat
×
×
  • Create New...