   Texture only comming up with only 1 dimension
  Hi, I have an application that renders a bunch of triangles.  I have added Textures to them but only the first column of the texture bitmaps pixels appear on the triangle (they are repeated across the whole triangle).My vertex definition is:   [StructLayout(LayoutKind.Sequential)]   struct Vertex   {  public Vector4 Position;  public int Color;  public float Tu;  public float Tv;   }My vertex coordinates are:float f_triangleWidth = in_width;  i_numberOfTriangles++;  Vertex[] toAdd = new Vertex[6];    //always draw vertexes clockwise as they have no reverse face and will be transparent otherwise  //bottom left  toAdd[0].Position = new Vector4(in_x - f_triangleWidth, in_y - f_triangleWidth, in_z, 1.0f);  toAdd[0].Color = Color.White.ToArgb();  toAdd[0].Tu = 0.0f;  toAdd[0].Tv = 0.0f;  //top right  toAdd[1].Position = new Vector4(in_x + f_triangleWidth, in_y + f_triangleWidth, in_z, 1.0f);  toAdd[1].Color = Color.White.ToArgb();  toAdd[1].Tu = 1.0f;  toAdd[1].Tv = 1.0f;  //bottom right  toAdd[2].Position = new Vector4(in_x + f_triangleWidth, in_y - f_triangleWidth, in_z, 1.0f);  toAdd[2].Color = Color.White.ToArgb();  toAdd[2].Tu = 1.0f;  toAdd[2].Tv = 0.0f;  //reverse face (drawn anticlockwise  //bottom left  toAdd[3].Position = new Vector4(in_x - f_triangleWidth, in_y - f_triangleWidth, in_z, 1.0f);  toAdd[3].Color = Color.White.ToArgb();  toAdd[3].Tu = 0.0f;  toAdd[3].Tv = 0.0f;  //bottom right  toAdd[4].Position = new Vector4(in_x + f_triangleWidth, in_y - f_triangleWidth, in_z, 1.0f);  toAdd[4].Color = Color.White.ToArgb();  toAdd[4].Tu = 1.0f;  toAdd[4].Tv = 0.0f;  //top right  toAdd[5].Position = new Vector4(in_x + f_triangleWidth, in_y + f_triangleWidth, in_z, 1.0f);  toAdd[5].Color = Color.White.ToArgb();  toAdd[5].Tu = 1.0f;  toAdd[5].Tv = 1.0f;  vertexes.AddRange(toAdd);My loading code is:  Device.SetRenderState(RenderState.Lighting, true);  Device.SetLight(0, light);  Device.EnableLight(0, true);  Material material = new Material();  material.Diffuse = Color.White;  material.Ambient = Color.White;  Device.Material = material;  testTexture = Texture.FromFile(Device, "testtexture.bmp");    //setup verticies  //this allocates space on the GPU for i_numberOfTriangles * 6 vertexes (3 for each face front and back)  Vertices = new VertexBuffer(Device, i_numberOfTriangles * 6 * Marshal.SizeOf(typeof(Vertex)), Usage.WriteOnly, VertexFormat.None, Pool.Managed);    //tell the GPU that you want to write to the memory you just allocated  DataStream stream = Vertices.Lock(0, 0, LockFlags.None); //send the CPU memory into the GPU memory  stream.WriteRange(vertexes.ToArray());  //tell the GPU you are finished writting to its memory  Vertices.Unlock();My drawing code is:  Device.SetStreamSource(0, Vertices, 0,Marshal.SizeOf(typeof(Vertex)) );Device.VertexFormat = VertexFormat.Position | VertexFormat.Diffuse | VertexFormat.Texture1;Device.SetTexture(0, testTexture);//render the triangles (front and backDevice.DrawPrimitives(PrimitiveType.TriangleList, 0, i_numberOfTriangles * 2);Device.EndScene();Device.Present();I'd appreciate any help you could offer.Here are the images:What is drawn on screen: http://img44.imageshack.us/img44/2153/drawny.jpgActual Texture: http://img11.imageshack.us/img11/9884/testtexture.png   
  It looks like your FVF says you're giving it regular position (float3, D3DFVF_XYZ), while your vertex format is designed for pre-transformed data (float4, D3DFVF_XYZRHW).The means the 1.0f W coord will be used for color,color will be used as the U coordinate,and the U coordinate will be used as the V coordinate.;  Thanks for the help! fixed it by changing the position vector to Vector3 instead of 4 and deleting the Color from the structure (and removing the VertexFormat.Diffuse).  The new code is:Vertex Definition:   [StructLayout(LayoutKind.Sequential)]   struct Vertex   {  public Vector3 Position;  public float Tu;  public float Tv;   }FVF:Device.VertexFormat = VertexFormat.Position |VertexFormat.Texture1;For anyone else with a similar problem, FVF is explained nicely here:http://www.toymaker.info/Games/html/fvf.html   