Hello.
I want to animate a BillboardSceneNode using a spritesheet, so I need to set texture's source rectangle.
How I can do this?
Thanks!
Source rectangle of texture
Re: Source rectangle of texture
Generally i know two ways: 1) modify texture coords of the mesh; 2) modify texture matrix of the material.
First case is not possible for billboards, because IBillboardSceneNode doesn't expose the mesh. Second way is possible, because it inherited from ISceneNode, which has getMaterial(). So you can try to do next:
First case is not possible for billboards, because IBillboardSceneNode doesn't expose the mesh. Second way is possible, because it inherited from ISceneNode, which has getMaterial(). So you can try to do next:
Code: Select all
billboardnode->getMaterial(0).getTextureMatrix(0).setTranslation(0.5f, 0.5f, 0 /* i believe this arg not used */);
Re: Source rectangle of texture
It Works
Thank you very much!
Thank you very much!