Getting a Sprite's Vertex
Blitz3D Forums/Blitz3D Programming/Getting a Sprite's Vertex
| ||
I've got a standard blitz sprite and I need to get the index of each vertex, and the surface. The reason being, I wan't to flip the sprite's texture without having to make a duplicate, flipped texture in the video memory. The only real way to do this would to get each of its vertices, and change the UV co-ordinates. Is this even possible? |
| ||
I don't think it's possible with a blitz sprite, but create a flat quad mesh and use that. |
| ||
You could change the view mode of the sprite, then rotate the sprite on it's X Axis 180. This will flip the sprite upside down. You might need to use an entityfx flag, to disable back face culling so you can see both sides of it. That will work though. |
| ||
Ross, wouldnt that mean the sprite could no longer automatically turn to face the camera? If I set it back to the old view mode it would flip back to how it was before? |
| ||
You can make the sprite face the camera by rotating the sprite to the same rotation values as the camera, then doing something like:RotateEntity Sprite, EntityPitch(camera,true), EntityYaw(camera,true), 0 RotateEntity Sprite, EntityPitch(Sprite,true)+180, EntityYaw(Sprite,true), EntityRoll(Sprite,true) The first rotateentity statement rotates the sprite to face the camera, but doesn't roll with the camera. You can make it roll with the camera simply by using the cameras roll values :o) The second rotateentity statement flips the sprite round. Hope that helps. Just remember, and use the spriteviewmode that makes the sprite freely rotatable. |
| ||
Okay cheers for that! |