Here's an image to help explain:
The bars are one group, and the squares should have a circle texture. As you can see, it's not working. There's nothing wrong with the texture; I've tried disabling the creation of the bar objects, and the circles display fine.
I'm using IrrlichtLime 1.2 and C#. This is the code for the mesh:
Code: Select all
MeshBuffer meshBuffer = MeshBuffer.Create( VertexType.Standard, IndexType._16Bit );
Vertex3D[] vertices = new Vertex3D[4];
vertices[0] = new Vertex3D( 0, 0, 1, 0, 0, 0, Color.OpaqueWhite, 1, 1 );
vertices[1] = new Vertex3D( 0, 0, 0, 0, 0, 0, Color.OpaqueWhite, 0, 1 );
vertices[2] = new Vertex3D( 1, 0, 0, 0, 0, 0, Color.OpaqueWhite, 0, 0 );
vertices[3] = new Vertex3D( 1, 0, 1, 0, 0, 0, Color.OpaqueWhite, 1, 0 );
ushort[] indices = new ushort[] { 0, 1, 2, 0, 2, 3 };
meshBuffer.Append( vertices, indices );
Mesh mesh = Mesh.Create();
mesh.AddMeshBuffer( meshBuffer );
mesh.RecalculateBoundingBox();
Code: Select all
Material mat = new Material();
mat.SetTexture( 0, m_textures["asteroid"] );
mat.SetFlag( MaterialFlag.Lighting, false );
mat.SetFlag( MaterialFlag.TrilinearFilter, true );
mat.SetFlag( MaterialFlag.AnisotropicFilter, true );
mat.SetFlag( MaterialFlag.BlendOperation, true );
The bar objects are created with this code:
Code: Select all
MeshSceneNode m;
foreach( AsteroidField ast in m_map.Asteroids )
{
m = m_sceneManager.AddMeshSceneNode( mesh );
m.Position = new Vector3Df( ast.Y, 0, ast.X );
m.SetMaterial( 0, mat );
}
Code: Select all
mat = new Material();
mat.SetTexture( 0, m_textures["star"] );
mat.SetFlag( MaterialFlag.Lighting, false );
mat.SetFlag( MaterialFlag.TrilinearFilter, true );
mat.SetFlag( MaterialFlag.AnisotropicFilter, true );
mat.SetFlag( MaterialFlag.BlendOperation, true );
Code: Select all
foreach( Star star in m_map.Stars )
{
m = m_sceneManager.AddMeshSceneNode( mesh );
m.Position = new Vector3Df( star.Y, 0, star.X );
m.SetMaterial( 0, mat );
}
I've tried searching but all I could find was people not having textures working at all, whereas this seems to be something else.