2D Toolkit Forum

2D Toolkit => Support => Topic started by: bcullis on October 07, 2013, 04:23:10 pm

Title: Correctly accessing sprite's mesh vertices?
Post by: bcullis on October 07, 2013, 04:23:10 pm
My goal is to apply a shear operation to a sprite, basically taking the top two verts and moving them over and down a little (i.e. from square to parallelogram).  I've almost achieved the same effect with simple localScale modifications (minus the sideways move), but for more flexibility and other ideas being tossed around, what's the correct (if any) way to access the positional data of the sprite's mesh vertices?  Do I directly modify sprite.positions?  I tried that and got some incredibly weird artifacts instead of expected behavior, so I'm not sure if that's the right path to be going down.

Thanks!  TK2D has been awesome to work with!
Title: Re: Correctly accessing sprite's mesh vertices?
Post by: unikronsoftware on October 07, 2013, 11:41:54 pm
I suggest looking at the clipped sprite code. That takes the sprite and manipulates the verts - you could probably base your sheer behaviour in a similar way.