- Home /
Question by
MountDoomTeam · Mar 17, 2013 at 10:37 AM ·
normalshighlight
What is happening to these normals?
I have some marching cubes with complicated formulas generating them, everything is 100% good except some of the shadows, and I don't understand why, for example, a single triangle can go through 270 degrees of shadows even when the triangle's corner normals are only 90 degrees difference. 
here is a code for highlighting normals in scene view also for reference
#pragma strict
function Update () {
var mesh : Mesh = GetComponent(MeshFilter).mesh;
var vertices : Vector3[] = mesh.vertices;
var normals : Vector3[] = mesh.normals;
for (var i = 0 ; i < vertices.length; i++){//change all the UVs say they face flat on one axis
vertices[i] = transform.TransformPoint(vertices[i] );
Debug.DrawLine (vertices[i], vertices[i] + (normals[i] * 0.1), Color.yellow);
}
}
happening to normal.jpg
(884.0 kB)
Comment
Your answer
Follow this Question
Related Questions
What are normals? 1 Answer
Set Terrain Normals 2 Answers
blender mesh invisible 6 Answers
Extract sub-mesh from a mesh 0 Answers
How do I fix my Normals (I have flipped them and does not work) 0 Answers