资源简介
Graphics Gems图形图像编程精粹所有源代码
代码片段和文件信息
/*
Fast Anti-Aliasing Polygon Scan Conversion
by Jack Morrison
from “Graphics Gems“ Academic Press 1990
user provides screenX() vLerp() and renderPixel() routines.
*/
/*
* Anti-aliased polygon scan conversion by Jack Morrison
*
* This code renders a polygon computing subpixel coverage at
* 8 times Y and 16 times X display resolution for anti-aliasing.
* One optimization left out for clarity is the use of incremental
* interpolations. X coordinate interpolation in particular can be
* with integers. See Dan Field‘s article in ACM Transactions on
* Graphics January 1985 for a fast incremental interpolator.
*/
#include
#include “GraphicsGems.h“
#define SUBYRES 8 /* subpixel Y resolution per scanline */
#define SUBXRES 16 /* subpixel X resolution per pixel */
#define MAX_AREA (SUBYRES*SUBXRES)
#define MODRES(y) ((y) & 7) /*subpixel Y modulo */
#define MAX_X 0x7FFF /* subpixel X beyond right edge */
typedef struct SurfaceStruct { /* object shading surface info */
int red green blue; /* color components */
} Surface;
/*
* In real life SurfaceStruct will contain many more parameters as
* required by the shading and rendering programs such as diffuse
* and specular factors texture information transparency etc.
*/
typedef struct VertexStruct { /* polygon vertex */
Vector3 model world /* geometric information */
normal image;
int y; /* subpixel display coordinate */
} Vertex;
Vertex *Vleft *VnextLeft; /* current left edge */
Vertex *Vright *VnextRight; /* current right edge */
struct SubPixel { /* subpixel extents for scanline */
int xLeft xRight;
} sp[SUBYRES];
int xLmin xLmax; /* subpixel x extremes for scanline */
int xRmax xRmin; /* (for optimization shortcut) */
/* Compute sub-pixel x coordinate for vertex */
extern int screenX(/* Vertex *v */);
/* Interpolate vertex information */
extern void vLerp(/* double alpha Vertex *Va *Vb *Vout */);
/* Render polygon for one pixel given coverage area */
/* and bitmask */
extern void renderPixel(/* int x y Vertex *V
int area unsigned mask[]
Surface *object */);
/*
* Render shaded polygon
*/
drawPolygon(polygon numVertex object)
Vertex polygon[]; /*clockwise clipped vertex list */
int numVertex; /*number of vertices in polygon */
Surface *object; /* shading parms for this object */
{
Vertex *endPoly; /* end of polygon vertex list */
Vertex VscanLeft VscanRight; /* interpolated vertices */ /* at scanline */
double aLeft aRight; /* interpolation ratios */
struct SubPixel *sp_ptr; /* current subpixel info */
int xLeft xNextLeft; /* subpixel coordinates for */
int xRight xNextRight; /* active polygon edges */
int iy;
/* find vertex with minimum y (display coordinate) */
Vleft = polygon;
for (i=1; i if (polygon[i].y < Vleft->y)
Vleft = &polygon[i];
endPoly = &polygon[numVertex-1];
/* initialize scanning edges */
Vright = VnextRight = VnextLeft = Vleft
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2015-01-01 16:45 Graphics Gems图形图像编程精粹所有源代码\
目录 0 2015-01-01 16:45 Graphics Gems图形图像编程精粹所有源代码\GraphicsGems\
文件 27375 2000-06-29 08:23 Graphics Gems图形图像编程精粹所有源代码\GraphicsGems\AllGems.TOC
文件 73084 2001-12-05 07:49 Graphics Gems图形图像编程精粹所有源代码\GraphicsGems\authors.html
文件 59319 2001-12-05 07:49 Graphics Gems图形图像编程精粹所有源代码\GraphicsGems\category.html
文件 15715 2001-07-05 09:33 Graphics Gems图形图像编程精粹所有源代码\GraphicsGems\Errata.GraphicsGems
文件 10095 2002-05-12 12:20 Graphics Gems图形图像编程精粹所有源代码\GraphicsGems\Errata.GraphicsGemsII
文件 9459 2002-05-13 22:06 Graphics Gems图形图像编程精粹所有源代码\GraphicsGems\Errata.GraphicsGemsIII
文件 1593 2000-06-29 08:24 Graphics Gems图形图像编程精粹所有源代码\GraphicsGems\Errata.GraphicsGemsIV
文件 3373 2002-05-13 21:53 Graphics Gems图形图像编程精粹所有源代码\GraphicsGems\Errata.GraphicsGemsV
目录 0 2001-01-03 11:21 Graphics Gems图形图像编程精粹所有源代码\GraphicsGems\gems\
目录 0 2000-06-29 08:12 Graphics Gems图形图像编程精粹所有源代码\GraphicsGems\gems\2DClip\
文件 3146 2000-06-29 08:12 Graphics Gems图形图像编程精粹所有源代码\GraphicsGems\gems\2DClip\bio.c
文件 186 2000-06-29 08:12 Graphics Gems图形图像编程精粹所有源代码\GraphicsGems\gems\2DClip\box.h
文件 2899 2000-06-29 08:12 Graphics Gems图形图像编程精粹所有源代码\GraphicsGems\gems\2DClip\clip.c
文件 6783 2000-06-29 08:12 Graphics Gems图形图像编程精粹所有源代码\GraphicsGems\gems\2DClip\cross.c
文件 1795 2000-06-29 08:12 Graphics Gems图形图像编程精粹所有源代码\GraphicsGems\gems\2DClip\line.h
文件 212 2000-06-29 08:12 Graphics Gems图形图像编程精粹所有源代码\GraphicsGems\gems\2DClip\Makefile
目录 0 2000-06-29 08:12 Graphics Gems图形图像编程精粹所有源代码\GraphicsGems\gems\AALines\
文件 1074 2000-06-29 08:12 Graphics Gems图形图像编程精粹所有源代码\GraphicsGems\gems\AALines\00README
文件 5139 2000-06-29 08:12 Graphics Gems图形图像编程精粹所有源代码\GraphicsGems\gems\AALines\AALines.c
文件 1371 2000-06-29 08:12 Graphics Gems图形图像编程精粹所有源代码\GraphicsGems\gems\AALines\AALines.h
文件 1578 2000-06-29 08:12 Graphics Gems图形图像编程精粹所有源代码\GraphicsGems\gems\AALines\AAMain.c
文件 5772 2000-06-29 08:12 Graphics Gems图形图像编程精粹所有源代码\GraphicsGems\gems\AALines\AATables.c
文件 12331 2000-06-29 08:12 Graphics Gems图形图像编程精粹所有源代码\GraphicsGems\gems\AALines\FastMatMul.c
文件 1701 2000-06-29 08:12 Graphics Gems图形图像编程精粹所有源代码\GraphicsGems\gems\AALines\LongConst.h
文件 497 2000-06-29 08:12 Graphics Gems图形图像编程精粹所有源代码\GraphicsGems\gems\AALines\Makefile
文件 4502 2000-06-29 08:12 Graphics Gems图形图像编程精粹所有源代码\GraphicsGems\gems\AALines\utah.c
文件 859 2000-06-29 08:12 Graphics Gems图形图像编程精粹所有源代码\GraphicsGems\gems\AALines\utah.h
文件 7609 2000-06-29 08:12 Graphics Gems图形图像编程精粹所有源代码\GraphicsGems\gems\AAPolyScan.c
文件 4017 2000-06-29 08:12 Graphics Gems图形图像编程精粹所有源代码\GraphicsGems\gems\Albers.c
............此处省略623个文件信息
相关资源
- Interactive Computer Graphics:A Top-Down App
- Mentor Graphics Expedition PCB原版教程
- Fluid Simulation for Computer Graphics Second
- applied geostatistics with SGeMS
- FlexGraphics_Full_1.8.zip
- curves and surfaces for computer graphics
- Windows Graphics Programming Win32 GDI and Dir
- R Graphics Essentials for Great Data Visualiza
- 游戏编程精粹8英文版
- ggplot2.Elegant.Graphics.for.Data.Analysis.2nd
- Computer Graphics and Geometric Modeling. Impl
- MentorGraphics Hyperlynx 8.0破解
- R Graphics 3rd Edition
- R Graphics Essentials for Great Data Visualiza
- Fluid Simulation for Computer Graphics Second
- GPU gems 1 pdf
- SGeMS地质建模软件
- QtOpenGL以及Graphics-View框架整合的演示
- 基于Qt QGraphicsScene的画图演示
- 图形处理器架构(GPU_Architecture)与图
- sgems地质统计学手册
- source code for Computer Graphics: Programming
- FlexGraphics 1.8(免安装源码版)
- Geometric Tools for Computer Graphics
- 图形图像界的传世经典!Graphic.Gems.
- Fundamentals of Computer Graphics Fourth Editi
- GPU精粹3[GPU Gems3]全彩电子版
- Mathematics for Computer Graphics计算机图形
- Computer Animation Algorithms and Techniques T
- Real-Time Volume Graphics 电子书PDF
评论
共有 条评论