Animated 3D Sprite

Blitz3D Forums/Blitz3D Beginners Area/Animated 3D Sprite

pit me


OK then :)

1. createmesh has an optional parent param .. no need to do this manually.
2. mesh color is 255,255,255 by default .. no need to apply a brush.
3. if you create the vertices in clockwise order no need to use flipmesh.

Function CreateQuad(parent=0)

	sprite = CreateMesh( parent )
	v = CreateSurface( sprite )
	AddVertex ( v, -3, 3, 0, 1, 0)
	AddVertex ( v, 3, 3, 0, 0, 0)
	AddVertex ( v, 3, -3, 0, 0, 1)
	AddVertex ( v, -3, -3, 0, 1, 1)
	AddTriangle ( v, 0, 1, 2)
	AddTriangle ( v, 2, 3, 0)

	Return sprite
	
End Function