Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2005-07-23 20:09:08 +0400
committerDaniel Dunbar <daniel@zuster.org>2005-07-23 20:09:08 +0400
commit42da62679fc923c7a37c969d1b48e89f085a519f (patch)
tree68a0e2d55ffc25548278db5863865f534aa1cd32 /source
parent16b76eb0eca2a946103fb3a740a11d9156e7e12c (diff)
- removed mface->puno flags, was only used to flip normals in display
and this is better left to user (whee this was a fun commit! so much deleting!) - removed mesh_calculate_vertex_normals (replaced by mesh_calc_normals)
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/BKE_mesh.h6
-rw-r--r--source/blender/blenkernel/intern/DerivedMesh.c16
-rw-r--r--source/blender/blenkernel/intern/displist.c1
-rw-r--r--source/blender/blenkernel/intern/mesh.c78
-rw-r--r--source/blender/blenlib/BLI_editVert.h2
-rw-r--r--source/blender/makesdna/DNA_meshdata_types.h2
-rw-r--r--source/blender/python/api2_2x/NMesh.c1
-rw-r--r--source/blender/src/booleanops.c3
-rw-r--r--source/blender/src/buttons_editing.c19
-rw-r--r--source/blender/src/editmesh.c20
-rw-r--r--source/blender/src/editmesh_lib.c35
-rw-r--r--source/blender/src/meshtools.c36
12 files changed, 25 insertions, 194 deletions
diff --git a/source/blender/blenkernel/BKE_mesh.h b/source/blender/blenkernel/BKE_mesh.h
index f92ad61191c..7c28297194e 100644
--- a/source/blender/blenkernel/BKE_mesh.h
+++ b/source/blender/blenkernel/BKE_mesh.h
@@ -82,12 +82,6 @@ void mesh_get_texspace(struct Mesh *me, float *loc_r, float *rot_r, float *size_
void make_edges(struct Mesh *me);
- /** Generate the mesh vertex normals by averaging over connected faces.
- *
- * @param me The mesh to update.
- */
-void mesh_calculate_vertex_normals (struct Mesh *me);
-
/* Calculate vertex and face normals, face normals are returned in *faceNors_r if non-NULL
* and vertex normals are stored in actual mverts.
*/
diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c
index 598a8ae9ac4..89b6f1458a4 100644
--- a/source/blender/blenkernel/intern/DerivedMesh.c
+++ b/source/blender/blenkernel/intern/DerivedMesh.c
@@ -239,14 +239,10 @@ static void meshDM_drawFacesSolid(DerivedMesh *dm, int (*setMaterial)(int))
int a;
int glmode=-1, shademodel=-1, matnr=-1, drawCurrentMat=1;
-#define PASSVERT(index, punoBit) { \
+#define PASSVERT(index) { \
if (shademodel==GL_SMOOTH) { \
short *no = mvert[index].no; \
- if (mface->puno&punoBit) { \
- glNormal3s(-no[0], -no[1], -no[2]); \
- } else { \
- glNormal3sv(no); \
- } \
+ glNormal3sv(no); \
} \
glVertex3fv(mvert[index].co); \
}
@@ -273,11 +269,11 @@ static void meshDM_drawFacesSolid(DerivedMesh *dm, int (*setMaterial)(int))
if(shademodel==GL_FLAT)
glNormal3fv(nors);
- PASSVERT(mface->v1, ME_FLIPV1);
- PASSVERT(mface->v2, ME_FLIPV2);
- PASSVERT(mface->v3, ME_FLIPV3);
+ PASSVERT(mface->v1);
+ PASSVERT(mface->v2);
+ PASSVERT(mface->v3);
if (mface->v4) {
- PASSVERT(mface->v4, ME_FLIPV4);
+ PASSVERT(mface->v4);
}
}
}
diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.c
index ada30151d1e..19783978383 100644
--- a/source/blender/blenkernel/intern/displist.c
+++ b/source/blender/blenkernel/intern/displist.c
@@ -168,7 +168,6 @@ void displistmesh_to_mesh(DispListMesh *dlm, Mesh *me)
mf->v4= oldmf->v4;
mf->flag= oldmf->flag;
mf->mat_nr= oldmf->mat_nr;
- mf->puno= 0;
mf->edcode= ME_V1V2|ME_V2V3|ME_V3V4|ME_V4V1;
}
}
diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c
index 09922413bfb..0dbb9f0d64e 100644
--- a/source/blender/blenkernel/intern/mesh.c
+++ b/source/blender/blenkernel/intern/mesh.c
@@ -543,12 +543,6 @@ void test_index_mface(MFace *mface, int nr)
if(a & ME_V1V2) mface->edcode |= ME_V3V1;
if(a & ME_V2V3) mface->edcode |= ME_V1V2;
if(a & ME_V3V1) mface->edcode |= ME_V2V3;
-
- a= mface->puno;
- mface->puno &= ~15;
- if(a & ME_FLIPV1) mface->puno |= ME_FLIPV2;
- if(a & ME_FLIPV2) mface->puno |= ME_FLIPV3;
- if(a & ME_FLIPV3) mface->puno |= ME_FLIPV1;
}
}
else if(nr==4) {
@@ -561,13 +555,6 @@ void test_index_mface(MFace *mface, int nr)
if(a & ME_V2V3) mface->edcode |= ME_V2V3;
if(a & ME_V3V4) mface->edcode |= ME_V1V2;
if(a & ME_V4V1) mface->edcode |= ME_V4V1;
-
- a= mface->puno;
- mface->puno &= ~15;
- if(a & ME_FLIPV1) mface->puno |= ME_FLIPV3;
- if(a & ME_FLIPV2) mface->puno |= ME_FLIPV4;
- if(a & ME_FLIPV3) mface->puno |= ME_FLIPV1;
- if(a & ME_FLIPV4) mface->puno |= ME_FLIPV2;
}
}
}
@@ -631,12 +618,6 @@ void test_index_face(MFace *mface, TFace *tface, int nr)
if(a & ME_V1V2) mface->edcode |= ME_V3V1;
if(a & ME_V2V3) mface->edcode |= ME_V1V2;
if(a & ME_V3V1) mface->edcode |= ME_V2V3;
-
- a= mface->puno;
- mface->puno &= ~15;
- if(a & ME_FLIPV1) mface->puno |= ME_FLIPV2;
- if(a & ME_FLIPV2) mface->puno |= ME_FLIPV3;
- if(a & ME_FLIPV3) mface->puno |= ME_FLIPV1;
}
}
else if(nr==4) {
@@ -664,13 +645,6 @@ void test_index_face(MFace *mface, TFace *tface, int nr)
if(a & ME_V2V3) mface->edcode |= ME_V2V3;
if(a & ME_V3V4) mface->edcode |= ME_V1V2;
if(a & ME_V4V1) mface->edcode |= ME_V4V1;
-
- a= mface->puno;
- mface->puno &= ~15;
- if(a & ME_FLIPV1) mface->puno |= ME_FLIPV3;
- if(a & ME_FLIPV2) mface->puno |= ME_FLIPV4;
- if(a & ME_FLIPV3) mface->puno |= ME_FLIPV1;
- if(a & ME_FLIPV4) mface->puno |= ME_FLIPV2;
}
}
}
@@ -679,7 +653,7 @@ void flipnorm_mesh(Mesh *me)
{
MFace *mface;
MVert *mvert;
- int a, temp;
+ int a;
mvert= me->mvert;
a= me->totvert;
@@ -698,21 +672,10 @@ void flipnorm_mesh(Mesh *me)
SWAP(int, mface->v4, mface->v1);
SWAP(int, mface->v3, mface->v2);
test_index_mface(mface, 4);
- temp= mface->puno;
- mface->puno &= ~15;
- if(temp & ME_FLIPV1) mface->puno |= ME_FLIPV4;
- if(temp & ME_FLIPV2) mface->puno |= ME_FLIPV3;
- if(temp & ME_FLIPV3) mface->puno |= ME_FLIPV2;
- if(temp & ME_FLIPV4) mface->puno |= ME_FLIPV1;
}
else {
SWAP(int, mface->v3, mface->v1);
test_index_mface(mface, 3);
- temp= mface->puno;
- mface->puno &= ~15;
- if(temp & ME_FLIPV1) mface->puno |= ME_FLIPV3;
- if(temp & ME_FLIPV2) mface->puno |= ME_FLIPV2;
- if(temp & ME_FLIPV3) mface->puno |= ME_FLIPV1;
}
}
mface++;
@@ -894,7 +857,6 @@ void mball_to_mesh(ListBase *lb, Mesh *me)
mface->v3= index[2];
mface->v4= index[3];
- mface->puno= 0;
mface->edcode= ME_V1V2+ME_V2V3;
mface->flag = ME_SMOOTH;
@@ -1041,7 +1003,6 @@ void nurbs_to_mesh(Object *ob)
mface->v3= startvert+index[2];
mface->v4= 0;
- mface->puno= 7;
mface->edcode= ME_V1V2+ME_V2V3;
test_index_mface(mface, 3);
@@ -1177,43 +1138,6 @@ void mcol_to_tface(Mesh *me, int freedata)
}
}
-void mesh_calculate_vertex_normals(Mesh *me)
-{
- float (*tempNorms)[3]= MEM_callocN(me->totvert*sizeof(*tempNorms), "tempNorms");
- int i;
-
- for (i=0; i<me->totface; i++) {
- MFace *mf= &((MFace*) me->mface)[i];
- float f_no[3];
-
- if (!mf->v3)
- continue;
-
- if (mf->v4) {
- CalcNormFloat4(me->mvert[mf->v1].co, me->mvert[mf->v2].co, me->mvert[mf->v3].co, me->mvert[mf->v4].co, f_no);
- } else {
- CalcNormFloat(me->mvert[mf->v1].co, me->mvert[mf->v2].co, me->mvert[mf->v3].co, f_no);
- }
-
- VecAddf(tempNorms[mf->v1], tempNorms[mf->v1], f_no);
- VecAddf(tempNorms[mf->v2], tempNorms[mf->v2], f_no);
- VecAddf(tempNorms[mf->v3], tempNorms[mf->v3], f_no);
- if (mf->v4)
- VecAddf(tempNorms[mf->v4], tempNorms[mf->v4], f_no);
- }
- for (i=0; i<me->totvert; i++) {
- MVert *mv= &me->mvert[i];
- float *no= tempNorms[i];
-
- Normalise(no);
- mv->no[0]= (short)(no[0]*32767.0);
- mv->no[1]= (short)(no[1]*32767.0);
- mv->no[2]= (short)(no[2]*32767.0);
- }
-
- MEM_freeN(tempNorms);
-}
-
void mesh_delete_material_index(Mesh *me, int index) {
int i;
diff --git a/source/blender/blenlib/BLI_editVert.h b/source/blender/blenlib/BLI_editVert.h
index a5fcf32d76e..6263a35432d 100644
--- a/source/blender/blenlib/BLI_editVert.h
+++ b/source/blender/blenlib/BLI_editVert.h
@@ -85,7 +85,7 @@ typedef struct EditFace
short xs, ys; /* selection */
struct TFace tf; /* a copy of original tface. */
unsigned char mat_nr, flag;
- unsigned char f, f1, h, puno;
+ unsigned char f, f1, h;
unsigned char fast; /* only 0 or 1, for editmesh_fastmalloc */
unsigned char fgonf; /* flag for fgon options */
} EditFace;
diff --git a/source/blender/makesdna/DNA_meshdata_types.h b/source/blender/makesdna/DNA_meshdata_types.h
index 0a186765cae..3d2941e4d4c 100644
--- a/source/blender/makesdna/DNA_meshdata_types.h
+++ b/source/blender/makesdna/DNA_meshdata_types.h
@@ -36,7 +36,7 @@ struct Bone;
typedef struct MFace {
unsigned int v1, v2, v3, v4;
- char puno, mat_nr;
+ char pad, mat_nr;
char edcode, flag;
} MFace;
diff --git a/source/blender/python/api2_2x/NMesh.c b/source/blender/python/api2_2x/NMesh.c
index 0c9839460e6..d5e04b00f32 100644
--- a/source/blender/python/api2_2x/NMesh.c
+++ b/source/blender/python/api2_2x/NMesh.c
@@ -2337,7 +2337,6 @@ static void mface_from_data( MFace * mf, TFace * tf, MCol * col,
test_index_mface( mf, i );
}
- mf->puno = 0;
mf->mat_nr = from->mat_nr;
mf->edcode = 0;
mf->flag = from->mf_flag;
diff --git a/source/blender/src/booleanops.c b/source/blender/src/booleanops.c
index bd706dd592b..09b0629de1a 100644
--- a/source/blender/src/booleanops.c
+++ b/source/blender/src/booleanops.c
@@ -727,7 +727,6 @@ ConvertCSGDescriptorsToMeshObject(
mface->v4 = 0;
mface->edcode = ME_V1V2|ME_V2V3|ME_V3V4|ME_V4V1;
- mface->puno = 0;
mface->mat_nr = 0;
mface->flag = fdata->faceflag;
@@ -781,7 +780,7 @@ ConvertCSGDescriptorsToMeshObject(
me->totface = face_it->num_elements;
- mesh_calculate_vertex_normals(me);
+ mesh_calc_normals(me->mvert, me->totvert, me->mface, me->totface, NULL);
// thats it!
if (user_face_vertex_data) {
diff --git a/source/blender/src/buttons_editing.c b/source/blender/src/buttons_editing.c
index b6beb3e54e6..5198b37740b 100644
--- a/source/blender/src/buttons_editing.c
+++ b/source/blender/src/buttons_editing.c
@@ -2224,19 +2224,20 @@ static void editing_panel_mesh_tools1(Object *ob, Mesh *me)
uiBlockBeginAlign(block);
uiDefButF(block, NUM, REDRAWVIEW3D, "NSize:", 955, 131, 150, 19, &G.scene->editbutsize, 0.001, 2.0, 10, 0, "Sets the length to use when displaying face normals");
- uiDefButI(block, TOG|BIT|6, REDRAWVIEW3D, "Draw Normals", 955,110,150,19, &G.f, 0, 0, 0, 0, "Displays face normals as lines");
- uiDefButI(block, TOG|BIT|7, REDRAWVIEW3D, "Draw Faces", 955,88,150,19, &G.f, 0, 0, 0, 0, "Displays all faces as shades");
- uiDefButI(block, TOG|BIT|18, REDRAWVIEW3D, "Draw Edges", 955,66,150,19, &G.f, 0, 0, 0, 0, "Displays selected edges using hilights");
- uiDefButI(block, TOG|BIT|19, REDRAWVIEW3D, "Draw Creases", 955,44,150,19, &G.f, 0, 0, 0, 0, "Displays creases created for subsurf weighting");
- uiDefButI(block, TOG|BIT|20, REDRAWVIEW3D, "Draw Seams", 955,22,150,19, &G.f, 0, 0, 0, 0, "Displays UV unwrapping seams");
- uiDefButI(block, TOG|BIT|11, 0, "All Edges", 955, 0,150,19, &G.f, 0, 0, 0, 0, "Displays all edges in object mode without optimization");
+ uiDefButBitI(block, TOG, G_DRAWNORMALS, REDRAWVIEW3D, "Draw Normals", 955,110,150,19, &G.f, 0, 0, 0, 0, "Displays face normals as lines");
+ uiDefButBitI(block, TOG, G_DRAWFACES, REDRAWVIEW3D, "Draw Faces", 955,88,150,19, &G.f, 0, 0, 0, 0, "Displays all faces as shades");
+ uiDefButBitI(block, TOG, G_DRAWEDGES, REDRAWVIEW3D, "Draw Edges", 955,66,150,19, &G.f, 0, 0, 0, 0, "Displays selected edges using hilights");
+ uiDefButBitI(block, TOG, G_DRAWCREASES, REDRAWVIEW3D, "Draw Creases", 955,44,150,19, &G.f, 0, 0, 0, 0, "Displays creases created for subsurf weighting");
+ uiDefButBitI(block, TOG, G_DRAWSEAMS, REDRAWVIEW3D, "Draw Seams", 955,22,150,19, &G.f, 0, 0, 0, 0, "Displays UV unwrapping seams");
+ uiDefButBitI(block, TOG, G_ALLEDGES, 0, "All Edges", 955, 0,150,19, &G.f, 0, 0, 0, 0, "Displays all edges in object mode without optimization");
uiBlockEndAlign(block);
/* Measurement drawing options */
uiBlockBeginAlign(block);
- uiDefButI(block, TOG|BIT|22, REDRAWVIEW3D, "Edge Length", 1125,131,150,19, &G.f, 0, 0, 0, 0, "Displays selected edge lengths");
- uiDefButI(block, TOG|BIT|24, REDRAWVIEW3D, "Edge Angles", 1125,110,150,19, &G.f, 0, 0, 0, 0, "Displays the angles in the selected edges in degrees");
- uiDefButI(block, TOG|BIT|23, REDRAWVIEW3D, "Face Area", 1125,88,150,19, &G.f, 0, 0, 0, 0, "Displays the area of selected faces");
+ uiDefButBitI(block, TOG, G_DRAW_VNORMALS, REDRAWVIEW3D, "Draw VNormals",1125,110,150,19, &G.f, 0, 0, 0, 0, "Displays vertex normals as lines");
+ uiDefButBitI(block, TOG, G_DRAW_EDGELEN, REDRAWVIEW3D, "Edge Length", 1125,88,150,19, &G.f, 0, 0, 0, 0, "Displays selected edge lengths");
+ uiDefButBitI(block, TOG, G_DRAW_EDGEANG, REDRAWVIEW3D, "Edge Angles", 1125,66,150,19, &G.f, 0, 0, 0, 0, "Displays the angles in the selected edges in degrees");
+ uiDefButBitI(block, TOG, G_DRAW_FACEAREA, REDRAWVIEW3D, "Face Area", 1125,44,150,19, &G.f, 0, 0, 0, 0, "Displays the area of selected faces");
uiBlockEndAlign(block);
}
diff --git a/source/blender/src/editmesh.c b/source/blender/src/editmesh.c
index bcfc70c4e62..12b931d7431 100644
--- a/source/blender/src/editmesh.c
+++ b/source/blender/src/editmesh.c
@@ -857,13 +857,6 @@ static void fix_faceindices(MFace *mface, EditFace *efa, int nr)
if(a & ME_V1V2) mface->edcode |= ME_V3V1;
if(a & ME_V2V3) mface->edcode |= ME_V1V2;
if(a & ME_V3V1) mface->edcode |= ME_V2V3;
-
- a= mface->puno;
- mface->puno &= ~15;
- if(a & ME_FLIPV1) mface->puno |= ME_FLIPV2;
- if(a & ME_FLIPV2) mface->puno |= ME_FLIPV3;
- if(a & ME_FLIPV3) mface->puno |= ME_FLIPV1;
-
}
}
else if(nr==4) {
@@ -891,14 +884,6 @@ static void fix_faceindices(MFace *mface, EditFace *efa, int nr)
if(a & ME_V2V3) mface->edcode |= ME_V2V3;
if(a & ME_V3V4) mface->edcode |= ME_V1V2;
if(a & ME_V4V1) mface->edcode |= ME_V4V1;
-
- a= mface->puno;
- mface->puno &= ~15;
- if(a & ME_FLIPV1) mface->puno |= ME_FLIPV3;
- if(a & ME_FLIPV2) mface->puno |= ME_FLIPV4;
- if(a & ME_FLIPV3) mface->puno |= ME_FLIPV1;
- if(a & ME_FLIPV4) mface->puno |= ME_FLIPV2;
-
}
}
}
@@ -1051,7 +1036,6 @@ void load_editMesh(void)
if(efa->v4) mface->v4= (unsigned int) efa->v4->vn;
mface->mat_nr= efa->mat_nr;
- mface->puno= efa->puno;
mface->flag= efa->flag;
/* bit 0 of flag is already taken for smooth... */
@@ -1613,7 +1597,7 @@ typedef struct EditEdgeC
typedef struct EditFaceC
{
int v1, v2, v3, v4;
- unsigned char mat_nr, flag, f, h, puno, fgonf;
+ unsigned char mat_nr, flag, f, h, fgonf;
short pad1;
} EditFaceC;
@@ -1713,7 +1697,6 @@ static void *editMesh_to_undoMesh(void)
efac->flag= efa->flag;
efac->f= efa->f;
efac->h= efa->h;
- efac->puno= efa->puno;
efac->fgonf= efa->fgonf;
if(tface) {
@@ -1782,7 +1765,6 @@ static void undoMesh_to_editMesh(void *umv)
efa->flag= efac->flag;
efa->f= efac->f;
efa->h= efac->h;
- efa->puno= efac->puno;
efa->fgonf= efac->fgonf;
if(tface) {
diff --git a/source/blender/src/editmesh_lib.c b/source/blender/src/editmesh_lib.c
index e0b8afd4731..58879a39fbd 100644
--- a/source/blender/src/editmesh_lib.c
+++ b/source/blender/src/editmesh_lib.c
@@ -1312,8 +1312,8 @@ void vertexnormals(int testflip)
Mesh *me;
EditVert *eve;
EditFace *efa;
- float n1[3], n2[3], n3[3], n4[3], co[4], fac1, fac2, fac3, fac4, *temp;
- float *f1, *f2, *f3, *f4, xn, yn, zn;
+ float n1[3], n2[3], n3[3], n4[3], co[4], *temp;
+ float xn, yn, zn;
float len, area;
if(G.obedit && G.obedit->type==OB_MESH) {
@@ -1440,42 +1440,11 @@ void vertexnormals(int testflip)
/* vertex normal flip-flags for shade (render) */
efa= em->faces.first;
while(efa) {
- efa->puno=0;
-
- if(testflip) {
- f1= efa->v1->no;
- f2= efa->v2->no;
- f3= efa->v3->no;
-
- fac1= efa->n[0]*f1[0] + efa->n[1]*f1[1] + efa->n[2]*f1[2];
- if(fac1<0.0) {
- efa->puno = ME_FLIPV1;
- }
- fac2= efa->n[0]*f2[0] + efa->n[1]*f2[1] + efa->n[2]*f2[2];
- if(fac2<0.0) {
- efa->puno += ME_FLIPV2;
- }
- fac3= efa->n[0]*f3[0] + efa->n[1]*f3[1] + efa->n[2]*f3[2];
- if(fac3<0.0) {
- efa->puno += ME_FLIPV3;
- }
- if(efa->v4) {
- f4= efa->v4->no;
- fac4= efa->n[0]*f4[0] + efa->n[1]*f4[1] + efa->n[2]*f4[2];
- if(fac4<0.0) {
- efa->puno += ME_FLIPV4;
- }
- }
- }
/* projection for cubemap! */
xn= fabs(efa->n[0]);
yn= fabs(efa->n[1]);
zn= fabs(efa->n[2]);
- if(zn>xn && zn>yn) efa->puno += ME_PROJXY;
- else if(yn>xn && yn>zn) efa->puno += ME_PROJXZ;
- else efa->puno += ME_PROJYZ;
-
efa= efa->next;
}
}
diff --git a/source/blender/src/meshtools.c b/source/blender/src/meshtools.c
index 614baa80c1b..a2622982fae 100644
--- a/source/blender/src/meshtools.c
+++ b/source/blender/src/meshtools.c
@@ -561,8 +561,8 @@ void vertexnormals_mesh(Mesh *me)
{
MVert *mvert;
MFace *mface;
- float n1[3], n2[3], n3[3], n4[3], co[4], fac1, fac2, fac3, fac4, *temp;
- float *f1, *f2, *f3, *f4, xn, yn, zn, *normals;
+ float n1[3], n2[3], n3[3], n4[3], co[4], *temp;
+ float xn, yn, zn, *normals;
float *v1, *v2, *v3, *v4, len, vnor[3];
int a, testflip;
@@ -671,8 +671,6 @@ void vertexnormals_mesh(Mesh *me)
mface= me->mface;
mvert= me->mvert;
for(a=0; a<me->totface; a++, mface++) {
- mface->puno=0;
-
if(mface->v3==0) continue;
v1= (mvert+mface->v1)->co;
@@ -681,40 +679,10 @@ void vertexnormals_mesh(Mesh *me)
CalcNormFloat(v1, v2, v3, vnor);
- if(testflip) {
- f1= normals + 3*mface->v1;
- f2= normals + 3*mface->v2;
- f3= normals + 3*mface->v3;
-
- fac1= vnor[0]*f1[0] + vnor[1]*f1[1] + vnor[2]*f1[2];
- if(fac1<0.0) {
- mface->puno = ME_FLIPV1;
- }
- fac2= vnor[0]*f2[0] + vnor[1]*f2[1] + vnor[2]*f2[2];
- if(fac2<0.0) {
- mface->puno += ME_FLIPV2;
- }
- fac3= vnor[0]*f3[0] + vnor[1]*f3[1] + vnor[2]*f3[2];
- if(fac3<0.0) {
- mface->puno += ME_FLIPV3;
- }
- if(mface->v4) {
- f4= normals + 3*mface->v4;
- fac4= vnor[0]*f4[0] + vnor[1]*f4[1] + vnor[2]*f4[2];
- if(fac4<0.0) {
- mface->puno += ME_FLIPV4;
- }
- }
- }
/* proj for cubemap! */
xn= fabs(vnor[0]);
yn= fabs(vnor[1]);
zn= fabs(vnor[2]);
-
- if(zn>xn && zn>yn) mface->puno += ME_PROJXY;
- else if(yn>xn && yn>zn) mface->puno += ME_PROJXZ;
- else mface->puno += ME_PROJYZ;
-
}
MEM_freeN(normals);