Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
sgiflag.h
Package: glut23-src.zip [view]
Upload User: xk288cn
Upload Date: 2007-05-28
Package Size: 4876k
Code Size: 2k
Category:
GIS program
Development Platform:
Visual C++
- /*
- * sgiflag.h
- *
- */
- /* useful for lmdef, nurbssurface, nurbscurve, and more */
- #define ELEMENTS(x) (sizeof(x)/sizeof(x[0]))
- /* Define nurbs surface properties */
- #define S_NUMPOINTS 4
- #define S_ORDER 4 /* cubic, degree 3 */
- #define S_NUMKNOTS (S_NUMPOINTS + S_ORDER)
- #define S_NUMCOORDS 3
- #define T_NUMPOINTS 4
- #define T_ORDER 4
- #define T_NUMKNOTS (T_NUMPOINTS + T_ORDER)
- #define T_NUMCOORDS 3
- typedef GLfloat Knot;
- typedef GLfloat Point[3];
- typedef GLfloat TrimPoint[2];
- /* Trimming curves are either piecewise linear or nurbscurve */
- enum TrimType {PWL, CURVE};
- /* A trimming curve is made up of one or more trimming pieces.
- * A trimming piece may be of PWL or CURVE. If a trim piece is PWL,
- * it has at least two trim points, with each trim point composing
- * the endpoints of the line segments. If a trim piece is CURVE, it
- * has four trim points defining the cubic bezier trim.
- */
- #define MAX_PIECES 20
- struct TrimPieceStruct {
- enum TrimType type; /* type of the trim */
- int points; /* # of points in the trim piece */
- TrimPoint point[MAX_PIECES]; /* pointer to first trim point */
- };
- typedef struct TrimPieceStruct TrimPiece;
- struct TrimCurveStruct {
- int pieces;
- TrimPiece *trim;
- };
- typedef struct TrimCurveStruct TrimCurve;
- struct teststruct {
- int a, b, c[2];
- };
- typedef struct teststruct Test;
- /* function prototypes */
- static void interp(TrimPoint a, TrimPoint b, GLfloat d, TrimPoint result);
- static void join_trims(TrimPiece *trim1, TrimPiece *trim2, GLfloat radius);
- static void translate_trim(TrimPiece *trim, GLfloat tx, GLfloat ty);
- static void scale_trim(TrimPiece *trim, GLfloat sx, GLfloat sy);
- static void rotate_trim(TrimPiece *trim, GLfloat angle);
- static void copy_path(TrimCurve *src, TrimCurve **dst);
- static void init_trims(void);
- static void initialize(void);
- static void draw_nurb(GLboolean);
- static void draw_hull(Point cpoints[S_NUMPOINTS][T_NUMPOINTS]);
- static void dotrim(TrimCurve *curve);