I'm using Irrlicht with C# to develop an isometric RPG game.
I've got a big problem with sprites and isometric camera.
When the camera moves sprites disappears gradually like in these shoots:
I create the sprites with this code:
Code: Select all
float halfWidth = size.Width / 2;
MeshBuffer buff = MeshBuffer.Create(VertexType.Standard, IndexType._32Bit);
buff.Append(new Vertex3D[]{
new Vertex3D(new Vector3Df(-halfWidth, 0, 0), new Vector3Df(0, 0, 0), Color.OpaqueWhite, new Vector2Df(0,1)),
new Vertex3D(new Vector3Df(halfWidth, 0, 0), new Vector3Df(0, 0, 0), Color.OpaqueWhite, new Vector2Df(1,1)),
new Vertex3D(new Vector3Df(-halfWidth, size.Height, 0), new Vector3Df(0, 0, 0), Color.OpaqueWhite, new Vector2Df(0,0)),
new Vertex3D(new Vector3Df(halfWidth, size.Height, 0), new Vector3Df(0, 0, 0), Color.OpaqueWhite, new Vector2Df(1,0))},
new uint[] { 1, 0, 2, 1, 2, 3 });
buff.RecalculateBoundingBox();
Mesh mesh = Mesh.Create();
mesh.AddMeshBuffer(buff);
buff.Drop();
mesh.RecalculateBoundingBox();
sceneNode = Engine.device.SceneManager.AddMeshSceneNode(mesh, null, -1, position);
sceneNode.SetMaterialTexture(0, Engine.device.VideoDriver.GetTexture("data/spritesheets/" + name + ".png"));
sceneNode.SetMaterialFlag(MaterialFlag.Lighting, false);
sceneNode.SetMaterialType(MaterialType.TransparentAlphaChannelRef);
sceneNode.SetMaterialFlag(MaterialFlag.BilinearFilter, false);
sceneNode.SetMaterialFlag(MaterialFlag.BackFaceCulling, false);
sceneNode.AutomaticCulling = CullingType.Off;
Thank you.
EDIT: OpenGL Works properly... but I need it in DX9