![]() |
| | #1 |
| Registered User Join Date: Aug 2004
Posts: 731
| Lighting in Managed Direct3d Code: public static Face ConstructFace(Vector3 vec1, Vector3 vec2, Vector3 vec3, Color color)
{
ShapeVertex[] verts = new ShapeVertex[3];
//Normal is caluclated here
Vector3 v1 = vec2 - vec1;
Vector3 v2 = vec3 - vec1;
Vector3 norm = Vector3.Cross(v1, v2);
norm.Normalize();
verts[0] = new ShapeVertex(vec1.X, vec1.Y, vec1.Z, norm.X, norm.Y, norm.Z, color);
verts[1] = new ShapeVertex(vec2.X, vec2.Y, vec2.Z, norm.X, norm.Y, norm.Z, color);
verts[2] = new ShapeVertex(vec3.X, vec3.Y, vec3.Z, norm.X, norm.Y, norm.Z, color);
return new Face(verts);
}
The face is lit by the light. But if ANY part of the face (no matter how small or big) is out of the screen, the face becomes unlit and black. I am using a simple point light that does reach the object fully, it has a large range. I have a big feeling this has nothing to do with my lights or normals at all, but rather somthing else. Anyone know anything on this? |
| Rune Hunter is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Direct3D Alpha Blend with Lighting ? | rocketman03 | Game Programming | 10 | 07-07-2009 04:04 PM |
| passing params between managed c++ and unmanaged c++ | cechen | C++ Programming | 11 | 02-03-2009 08:46 AM |
| Eliminating lighting "over-bright" | psychopath | Game Programming | 1 | 05-31-2006 06:52 PM |
| Need help with getting DirectX 9.0 initilization | DarkMortar | Windows Programming | 7 | 05-09-2006 08:58 PM |
| Lighting a Direct3D 9 mesh sphere | bennyandthejets | Game Programming | 12 | 02-14-2005 01:19 AM |