autoDeriveVertexNormals

Software: Away3D 4.x

inSertCodE, Sr. Member
Posted: 29 November 2011 01:58 PM   Total Posts: 105

If I autoDeriveVertexNormals on a plane with different vertex heights (y), what kind of normals will I get? Will they be average?

   

Avatar
Fabrice Closier, Administrator
Posted: 29 November 2011 04:09 PM   Total Posts: 1265   [ # 1 ]

yes normally, as the primitive Plane uses unique vertices.

   

inSertCodE, Sr. Member
Posted: 29 November 2011 11:44 PM   Total Posts: 105   [ # 2 ]

Thanks Fabrice I appreciate it. This is confirmed. I made a test.

_Terain.subMeshes[0].subGeometry.vertexData[38878] += 20;
   
_Terain.subMeshes[0].subGeometry.vertexData[38881] += 20;
   
_Terain.subMeshes[0].subGeometry.vertexData[39361] += 20;
   
_Terain.subMeshes[0].subGeometry.vertexData[39364] += 20;
   
   
   
trace(_Terain.subMeshes[0].subGeometry.vertexNormalData[38877]);
   
trace(_Terain.subMeshes[0].subGeometry.vertexNormalData[38878]);
   
trace(_Terain.subMeshes[0].subGeometry.vertexNormalData[38879]);
   
   
_Terain.subMeshes[0].subGeometry.autoDeriveVertexNormals true;
   
   
trace(_Terain.subMeshes[0].subGeometry.vertexNormalData[38877]);
   
trace(_Terain.subMeshes[0].subGeometry.vertexNormalData[38878]);
   
trace(_Terain.subMeshes[0].subGeometry.vertexNormalData[38879]); 

1. I’ve traced the normals of a vertex.
2. I’ve pulled up a square from a 160x160 plane, from which one of the edges is the mentioned vertex.
3. Set the autoDeriveVertexNormals to true.
4. I’ve traced the normals of the same vertex.

And the results are:
Before:
0
1
0

After:
-0.3926533002060407
0.8316530356312115
-0.3926533002060414

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X