-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path3dNTDraw.c
47 lines (42 loc) · 1.14 KB
/
3dNTDraw.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*****************************************************************************
* file: "3dNTDrawing.c"
*
* purpose: non-transformed drawing routines for use with
* three dimensional graphics applications which use
* the "3d.c" and "FixedMath.c" functions.
*
* ©1990 Mark M. Owen. All rights reserved.
*****************************************************************************/
#include "xvt.h"
#include "3d.h"
#include "3dNTDraw.h"
#include "3dFMath.h"
/*****************************************************************************
*
* Function: ntDrawLine3d
*
* purpose: clips, projects and draws a line from one point to another.
*
* warning: it is assumed the start and end points were transformed
* prior to calling this function.
*****************************************************************************
*/
void
#if XVT_CC_PROTO
ntDrawLine3d(Point3d *pf,Point3d *pt)
#else
ntDrawLine3d(pf, pt)
Point3d *pf, *pt;
#endif
{
Point3d p1,p2;
Point2d s;
p1=*pf;
p2=*pt;
if (ClipLine(&p1,&p2)==is_visible)
{ Project(&p1, &s);
MoveTo(Fix2Int(s.x), Fix2Int(s.y));
Project(&p2, &s);
LineTo(Fix2Int(s.x), Fix2Int(s.y));
}
}