mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-04 17:50:11 +01:00
Compute first partials before taking cross product to calculate normal.
Fixes diego santa cruz' nurbs lighting bug.
This commit is contained in:
parent
9a90775010
commit
3d1df5554e
1 changed files with 9 additions and 1 deletions
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: t_imm_eval.c,v 1.14 2001/08/01 05:10:42 keithw Exp $ */
|
||||
/* $Id: t_imm_eval.c,v 1.15 2001/08/14 00:50:44 keithw Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
|
|
@ -206,6 +206,14 @@ static void eval2_obj_norm( GLvector4f *obj_ptr,
|
|||
_math_de_casteljau_surf(map->Points, obj[i], du, dv, u, v, dimension,
|
||||
map->Uorder, map->Vorder);
|
||||
|
||||
du[0] = du[0]*obj[i][3] - du[3]*obj[i][0];
|
||||
du[1] = du[1]*obj[i][3] - du[3]*obj[i][1];
|
||||
du[2] = du[2]*obj[i][3] - du[3]*obj[i][2];
|
||||
|
||||
dv[0] = dv[0]*obj[i][3] - dv[3]*obj[i][0];
|
||||
dv[1] = dv[1]*obj[i][3] - dv[3]*obj[i][1];
|
||||
dv[2] = dv[2]*obj[i][3] - dv[3]*obj[i][2];
|
||||
|
||||
CROSS3(normal[i], du, dv);
|
||||
NORMALIZE_3FV(normal[i]);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue