From 7aee6df131423fca28b2f7aeeef2b18beddf73eb Mon Sep 17 00:00:00 2001 From: havoc Date: Sat, 15 Jan 2005 02:08:45 +0000 Subject: [PATCH] normalize after the CrossProduct git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@4935 d7cf8633-e32d-0410-b094-e92efae38249 --- r_lightning.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/r_lightning.c b/r_lightning.c index 74b397bb..1f5f90ce 100644 --- a/r_lightning.c +++ b/r_lightning.c @@ -253,11 +253,11 @@ void R_DrawLightningBeamCallback(const void *calldata1, int calldata2) // (this leaves only a vector pointing directly away from the beam) t1 = -DotProduct(up, beamdir); VectorMA(up, t1, beamdir, up); - // now we have a vector pointing away from the beam, now we need to normalize it - VectorNormalizeFast(up); - // generate right vector from forward and up, the result is already normalized - // (CrossProduct returns a vector of multiplied length of the two inputs) + // generate right vector from forward and up, the result is unnormalized CrossProduct(beamdir, up, right); + // now normalize the right vector and up vector + VectorNormalize(right); + VectorNormalize(up); // calculate T coordinate scrolling (start and end texcoord along the beam) t1 = r_refdef.time * -r_lightningbeam_scroll.value;// + beamrepeatscale * DotProduct(b->start, beamdir); -- 2.39.2