   help with simple question please...
  I have a normaltextured surface that is  a flat sheet with corner coordinates -100,-100 to 100,100.  I've set up the following spot light:this.device.Lights[0].Type = LightType.Spot;  this.device.Lights[0].Position = new Vector3(0, 100, 0);  this.device.Lights[0].Direction = new Vector3(0, -1, 0);  this.device.Lights[0].Diffuse = Color.White;  this.device.Lights[0].Ambient = Color.DarkGray;  this.device.Lights[0].Enabled = true;   it doesn't illuminate the surface.  If I use a directional light with the same direction it works.  What am I doing wrong?Thanks,Devin   
  It's hard to tell from the info that you provided but double-check your light position.  It's 100 units directly above the origin in world space.  I can't tell where your quad is because you've left off the Z coordinates and I have no idea what your world matrix is doing, but if it's in the X-Y plane as the vertices suggest, your light is located on the plane itself and pointing down the negative Z axis (which itself is odd).Usually when directional lighting works and spot lighting doesn't it's usually due to:1) Light position (check your range and attenuation values)2) The angle between the light position and the vertex/vertices is beyond the cone of the spotlight, or the angle is so great that the light contribution at this angle is so minimal that the vertex appears to not be lighted.  Did you even set the spotlight cone angle or did you leave it at zero?You might want to start with a positional light first, then move on to a spotlight.  It's an incremental step that will help you narrow down your lighting problem.  Also realize, that with a spotlight pointed at a large quad, you won't end up with a nice circle of light near the center of the mesh.  The vertices will be lit and then that value will be interpolated across the face of the mesh.  In order to get the 'circle' that most people expect you'll either need to tesselate your mesh or use some sort of per-pixel lighting technique.Finally, please-please-please choose a subject for your initial post that has something to do with the question that you're asking.  Read the "Want to post? ..." sticky thread at the top of the DirectX Forum for details.  Thanks!;  sorry, kinda looked like xy but really I was setting x,z values for my surface.  Here is the actual code for the verts.  this.dtverts = new CustomVertex.PositionNormalTextured[6];  this.dtverts[0] = new CustomVertex.PositionNormalTextured(-100f, 0f, -100f, 0f, 1f, 0f, 0f, 0f);  this.dtverts[1] = new CustomVertex.PositionNormalTextured(100f, 0f, 100f, 0f, 1f, 0f, 1f, 1f);  this.dtverts[2] = new CustomVertex.PositionNormalTextured(100f, 0f, -100f, 0f, 1f, 0f, 1f, 0f);  this.dtverts[3] = new CustomVertex.PositionNormalTextured(-100f, 0f, -100f, 0f, 1f, 0f, 0f, 0f);  this.dtverts[4] = new CustomVertex.PositionNormalTextured(-100f, 0f, 100f, 0f, 1f, 0f, 0f, 1f);  this.dtverts[5] = new CustomVertex.PositionNormalTextured(100f, 0f, 100f, 0f, 1f, 0f, 1f, 1f);perhaps it would be helpful to tell me the minimum settings to setup a point or spot light.  I can't seem to get the point light to work either.  And my world matrix is set to identity.   ;  Is a light position and direction effected by the world matrix or view matrix or other?-Devin   ;  OK, if the positional light doesn't work but the directional light does, then it's either the range/attenuation values, or the angle between the light position and the vertex is so large that the contribution of this light is next to nothing.  Try positioning the light directly above one of the vertices and see if that makes a difference.;  what attenuation value to use?  Thanks for your help.   ;Quote:Try positioning the light directly above one of the vertices and see if that makes a difference.I think that should do it, you are putting a spotlight in the middle of a flat surface.  The thing is that if you arent doing per pixel lighting in a pixel shader, your lighting is based on the position of the vertex's then. It will take each of those vertex's and try to light them.  But since the spotlight is trying to light up the middle of the square, none of the vertex's are getting lit up.Try putting the light over a vertex and it should work, otherwise you aren't enabling all the needed information for the lights.   ;  To disable range-based attenuation of a light set the following in the light's D3DLIGHT9 structure:Attenuation0 = 1.0fAttenuation1 = 0.0fAttenuation2 = 0.0f;  Thanks, I created a kinda cool mesh grid using the following code:[source lang = c#]   public void CreatePlatform()   {  int numverts = 21 * 21;//21x by 21y two dimensional array represented by a one dimensional array  //create one long array for 2 dimensional array representation  CustomVertex.PositionNormalTextured[] verts = new CustomVertex.PositionNormalTextured[numverts];  for (int i = -100; i <= 100; i += 10) for (int j = -100; j <= 100; j += 10)verts[(((i + 100) / 10) * 21) + ((j + 100) / 10)] =    new CustomVertex.PositionNormalTextured((float)i, 0f, (float)j, 0f, 1f, 0f, (float)((i + 100) / 200), (float)((j + 100)/ 200));  short[] indices = new short[20 * 20 * 2 * 3];//20x20 grid with 2 triangles per grid square and 3 vertices per triangle.  int c = 0;  for (int i = 0; i < 20; i++) for (int j = 0; j < 20; j++) {//first triangleindices[c] = (short)((i * 21) + j);//first this rowindices[c + 1] = (short)(((i + 1) * 21) + j);//first next row indices[c + 2] = (short)(((i + 1) * 21) + j + 1);//second next row //second triangleindices[c + 3] = (short)((i * 21) + j);//first this row indices[c + 4] = (short)(((i + 1) * 21) + j + 1);//second next row indices[c + 5] = (short)((i * 21) + j + 1);//second first row //advance cc += 6; }  this.platform = new Mesh(20*20*2, numverts, MeshFlags.Managed, CustomVertex.PositionNormalTextured.Format, device);  using (VertexBuffer vb = this.platform.VertexBuffer)  { GraphicsStream data = vb.Lock(0, 0, LockFlags.None); data.Write(verts); vb.Unlock();  }  using (IndexBuffer ib = this.platform.IndexBuffer)  { ib.SetData(indices, 0, LockFlags.None);  }   }but for some reasong the normals are pointing the opposite way it seems.   ;  Is the mesh not being lit, or is it not drawn at all?If the latter, check your indices - you may be specifying the triangles with the wrong winding order which would make them back-facing.  An easy test would be to disable backface culling temporarily and see if the problem exists.   