From e40625431dffbdd685f2803b53bf2dea67f326ca Mon Sep 17 00:00:00 2001 From: havoc Date: Sun, 13 Jul 2003 04:09:47 +0000 Subject: [PATCH] fixed a severe bug in texcoord2f[] reading in Mod_BuildTextureVectorsAndNormals git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@3262 d7cf8633-e32d-0410-b094-e92efae38249 --- model_shared.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/model_shared.c b/model_shared.c index d600269b..c715e95b 100644 --- a/model_shared.c +++ b/model_shared.c @@ -531,9 +531,9 @@ void Mod_BuildTextureVectorsAndNormals(int numverts, int numtriangles, const flo if (tvector3f || svector3f) { // 3 assignments, 15 subtracts, 6 multiplies - tdir[0] = ((texcoord2f[e[1] * 3] - texcoord2f[e[0] * 3]) * (vertex3f[e[2]*3+0] - vertex3f[e[0]*3+0]) - (texcoord2f[e[2] * 3] - texcoord2f[e[0] * 3]) * (vertex3f[e[1]*3+0] - vertex3f[e[0]*3+0])); - tdir[1] = ((texcoord2f[e[1] * 3] - texcoord2f[e[0] * 3]) * (vertex3f[e[2]*3+1] - vertex3f[e[0]*3+1]) - (texcoord2f[e[2] * 3] - texcoord2f[e[0] * 3]) * (vertex3f[e[1]*3+1] - vertex3f[e[0]*3+1])); - tdir[2] = ((texcoord2f[e[1] * 3] - texcoord2f[e[0] * 3]) * (vertex3f[e[2]*3+2] - vertex3f[e[0]*3+2]) - (texcoord2f[e[2] * 3] - texcoord2f[e[0] * 3]) * (vertex3f[e[1]*3+2] - vertex3f[e[0]*3+2])); + tdir[0] = ((texcoord2f[e[1] * 2] - texcoord2f[e[0] * 2]) * (vertex3f[e[2]*3+0] - vertex3f[e[0]*3+0]) - (texcoord2f[e[2] * 2] - texcoord2f[e[0] * 2]) * (vertex3f[e[1]*3+0] - vertex3f[e[0]*3+0])); + tdir[1] = ((texcoord2f[e[1] * 2] - texcoord2f[e[0] * 2]) * (vertex3f[e[2]*3+1] - vertex3f[e[0]*3+1]) - (texcoord2f[e[2] * 2] - texcoord2f[e[0] * 2]) * (vertex3f[e[1]*3+1] - vertex3f[e[0]*3+1])); + tdir[2] = ((texcoord2f[e[1] * 2] - texcoord2f[e[0] * 2]) * (vertex3f[e[2]*3+2] - vertex3f[e[0]*3+2]) - (texcoord2f[e[2] * 2] - texcoord2f[e[0] * 2]) * (vertex3f[e[1]*3+2] - vertex3f[e[0]*3+2])); // 1 assignments, 1 negates, 2 adds, 3 multiplies f = -DotProduct(tdir, normal); // 3 assignments, 3 adds, 3 multiplies -- 2.39.2