void vis_drawobject(object *o) { int a,b,c; long al,bl; nlist *n; int *ijp; if(!(o->flags&F_VISIBLE)) return; calc_rotate(o->vnum,o->v,o->v0,o->r); if(o->flags&F_GOURAUD) calc_nrotate(o->nnum,o->n,o->n0,o->r); else calc_nrotate(o->nnum1,o->n,o->n0,o->r); o->vf=calc_project(o->vnum,o->pv,o->v); if(o->vf) return; // object was completely out of screen a=0; al=0x7fffffffL; for(b=1;b<o->plnum;b++) { c=o->pl[b][1]; bl=(o->v+c)->z; if(bl<al) { al=bl; a=b; } } draw_polylist(o->pl[a],o->pd,o->v,o->pv,o->n,o->flags); }
void init_eye(t_mlx *win, t_elem *item) { if (item->ID != E_SPHERE) calc_rotate(&win->V_eye, item->rot, 0); translate_calc(&win->eye, item->pos, 0); }
void init_vect(t_vect3f *P, t_vect3f *V, t_elem *item) { if (item->ID != E_SPHERE) calc_rotate(V, item->rot, 0); translate_calc(P, item->pos, 0); }