#include "surfmodl.h" #include "math.h" void hiddenline() { int Node; /* node # */ int Surf; /* surface # */ char Cont; char *malloc(); double Xtmp,Ytmp; if ( (Viewchanged()) || (! Sorted) ) { menumsg ("Transforming to 2-D..."); if (Surfmin) Surfmin = (surfaces *)realloc(Surfmin,Nsurf * sizeof(surfaces)); else Surfmin = (surfaces *)malloc(Nsurf * sizeof(surfaces)); if (Surfmax) Surfmax = (surfaces *)realloc(Surfmax,Nsurf * sizeof(surfaces)); else Surfmax = (surfaces *)malloc(Nsurf * sizeof(surfaces)); /* Transform from 3-D to 2-D coordinates */ setorigin(); for ( Node = 0 ; Node < Nnodes ; Node++) perspect (Xworld[Node], Yworld[Node], Zworld[Node], &Xtran[Node], &Ytran[Node], &Ztran[Node]); /* Set plotting limits and normalize transformed coords to screen coords */ perspect (Xfocal, Yfocal, Zfocal, &Xfotran, &Yfotran, &Zfotran); if ( (! setnormal (Xfotran, Yfotran, &XYmax)) ) { menumsg ("Warning: Focal point is off the screen."); } /* Transform Clip planes */ cutplane(Zcutnear,&Ztrannear); /* Normalize all the nodes */ for ( Node = 0 ; Node