Flat Colored Meshes
Blitz3D Forums/Blitz3D Programming/Flat Colored Meshes
| ||
I've created a mesh and positioned it in my world. It does collision checking correctly and I can move all around it with my camera. All of that works well. However, no matter what I try, I cannot get the mesh to appear solid. It always appears flat, giving no indication of the various vertices and faces/triangles. All the faces are displayed correctly (meaning I can see them) but there is no difference in light or shadow anywhere on the mesh. I've tried everything I can think of, including adding and removing ambient light, dynamic lights, using a texture and vertex lighting. Nothing changes. I've added other primitives, like a cube and a cone, and those are lit correctly and display as actual 3D objects. Any ideas...? |
| ||
The normals probably aren't set correctly for your mesh. Try UpdateNormals. |
| ||
That did the trick! Thanks! |
| ||
Glad to help, but if at all possible have the normals set correctly in the mesh to begin with. UpdateNormals can be a slow command sometimes so avoid it if possible. I'm rather curious where you got a model without correct normals. Where did the model come from/what software was it created in, and what file format? |
| ||
Actually, I'm creating it myself on-the-fly. It's a randomly generated "wall" that I'm putting up around the player's area. Each time it's unique, which is what I want. Unless I regenerate the wall, I only have to use UpdateNormals once after I create the wall. Now all I have to do is get the texturing right and it will be perfect. |