1 |
/*****************************************************************
|
2 |
|
3 |
eval_normal.c Type:Func
|
4 |
|
5 |
Calcul en x y z de la normale a une surface
|
6 |
|
7 |
Date de creation : Mon Apr 21 10:38:26 1997
|
8 |
|
9 |
Derniere version : Tue Apr 22 11:41:53 1997
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
Vincent FRANCOIS
|
15 |
|
16 |
*****************************************************************/
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
/**************************/
|
23 |
/* include */
|
24 |
#include <stdio.h>
|
25 |
#include <string.h>
|
26 |
#include "const.h"
|
27 |
#include "struct.h"
|
28 |
#include "prototype.h"
|
29 |
|
30 |
/**************************/
|
31 |
/* variables globales */
|
32 |
extern struct environnment env;
|
33 |
extern struct s_mesh *mesh;
|
34 |
extern struct s_acis *acis;
|
35 |
|
36 |
|
37 |
|
38 |
/**************************/
|
39 |
/* programme principal */
|
40 |
|
41 |
void eval_normal(struct s_face *face,float *norm, float u,float v)
|
42 |
{
|
43 |
struct s_cone *cone;
|
44 |
struct s_plane *plane;
|
45 |
|
46 |
|
47 |
cone=NULL;
|
48 |
plane=NULL;
|
49 |
if (strcmp(acis->type_entite[face->surface],"cone-surface")==0)
|
50 |
cone=(struct s_cone *)acis->entity[face->surface];
|
51 |
if (strcmp(acis->type_entite[face->surface],"plane-surface")==0)
|
52 |
plane=(struct s_plane *)acis->entity[face->surface];
|
53 |
if (cone!=NULL) eval_cone(face,cone->param,&u,&v,NORMAL,&norm[0],&norm[1],&norm[2],0.);
|
54 |
if (plane!=NULL) eval_plane(face,plane->param,&u,&v,NORMAL,&norm[0],&norm[1],&norm[2]);
|
55 |
|
56 |
|
57 |
|
58 |
}
|