• 大小: 3.46MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-09-10
  • 语言: C/C++
  • 标签: raytracing  c++  

资源简介

光线跟踪算法 c++ 编写 有文档 ,有报告。

资源截图

代码片段和文件信息

/** 3DGPL *************************************************\
 * ()                                                     *
 * 2D line and polygon clipping.                          *
 *                                                        *
 * Defines:                                               *
 *  C_init_clipping          Setting bounds;              *
 *  C_get_bounds             Clipping window;             *
 *  C_set_bounds             Impose another condition;    *
 *                                                        *
 *  C_line_x_clipping        Clipping a line horizontally;*
 *  C_line_y_clipping        Clipping a line vertically;  *
 *                                                        *
 *  C_polygon_x_clipping     Horizontal polygon cliping.  *
 *                                                        *
 * (c) 1995-98 Sergei Savchenko (savs@cs.mcgill.ca)      *
\**********************************************************/

#include “RayTracing.h“           /* hardware specific stuff */
#include “Clipper.h“             /* 2D macros */

int C_2D_clipping;                          /* type of performed clipping */
int C_x_clipping_min=C_X_CLIPPING_MIN;      /* clipping bounds */
int C_x_clipping_max=C_X_CLIPPING_MAX;      /* default values */
int C_y_clipping_min=C_Y_CLIPPING_MIN;
int C_y_clipping_max=C_Y_CLIPPING_MAX;

/**********************************************************\
 * Setting bounds for 2D clipping.                        *
 *                                                        *
 * SETS: C_x_clipping_min...C_y_clipping_max            *
 * -----                                                  *
\**********************************************************/

void C_init_clipping(int minxint minyint maxxint maxy)
{
 C_x_clipping_min=minx;                     /* no error checking... */
 C_y_clipping_min=miny;
 C_x_clipping_max=maxx;
 C_y_clipping_max=maxy;
}

/**********************************************************\
 * Getting current state of bounds for 2D clipping.       *
\**********************************************************/

void C_get_bounds(int *minxint *minyint *maxxint *maxy)
{
 *minx=C_x_clipping_min;
 *miny=C_y_clipping_min;
 *maxx=C_x_clipping_max;
 *maxy=C_y_clipping_max;
}

/**********************************************************\
 * Imposing extra set of bounds for 2D clipping.          *
 *                                                        *
 * RETURNS: 0 when no clipping window exist;              *
 * -------- 1 when it does exist.                         *
 *                                                        *
 *   +--------+      merging two sets of conditions       *
 *   |   +-------+   old and new. Getting an intersection *
 *   |   |////|  |   where both old and new conditions    *
 *   +---|----+  |   are valid.                           *
 *       +-------+                                      

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      11031  2004-04-15 12:10  RayTracing\Clipp2D.cpp

     文件      11311  2004-04-15 12:13  RayTracing\Clipp3D.cpp

     文件       2132  2004-04-15 12:07  RayTracing\Clipper.h

     文件       3856  2004-04-11 15:00  RayTracing\Colour.cpp

     文件       7296  2004-04-11 15:31  RayTracing\Colour.h

     文件      32363  2004-04-15 12:02  RayTracing\data.cpp

     文件        759  2004-04-11 14:19  RayTracing\data.h

     文件      27632  2010-12-13 13:33  RayTracing\Debug\BuildLog.htm

     文件      27950  2010-12-13 13:33  RayTracing\Debug\Clipp2D.obj

     文件          0  2010-12-13 13:33  RayTracing\Debug\Clipp2D.sbr

     文件      26835  2010-12-13 13:33  RayTracing\Debug\Clipp3D.obj

     文件          0  2010-12-13 13:33  RayTracing\Debug\Clipp3D.sbr

     文件      20650  2010-12-13 13:33  RayTracing\Debug\Colour.obj

     文件          0  2010-12-13 13:33  RayTracing\Debug\Colour.sbr

     文件      49324  2010-12-13 13:33  RayTracing\Debug\data.obj

     文件          0  2010-12-13 13:33  RayTracing\Debug\data.sbr

     文件      35521  2010-12-13 13:33  RayTracing\Debug\Engbase.obj

     文件          0  2010-12-13 13:33  RayTracing\Debug\Engbase.sbr

     文件      40515  2010-12-13 13:33  RayTracing\Debug\EngBcub.obj

     文件          0  2010-12-13 13:33  RayTracing\Debug\EngBcub.sbr

     文件      39109  2010-12-13 13:33  RayTracing\Debug\EngPoly.obj

     文件          0  2010-12-13 13:33  RayTracing\Debug\EngPoly.sbr

     文件       1208  2004-04-15 12:15  RayTracing\Debug\Graphics.obj

     文件          0  2004-04-15 12:15  RayTracing\Debug\Graphics.sbr

     文件      25271  2010-12-13 13:33  RayTracing\Debug\Graphicsbase.obj

     文件          0  2010-12-13 13:33  RayTracing\Debug\Graphicsbase.sbr

     文件      37636  2010-12-13 13:33  RayTracing\Debug\GraphicsPoly.obj

     文件          0  2010-12-13 13:33  RayTracing\Debug\GraphicsPoly.sbr

     文件      20064  2010-12-13 13:33  RayTracing\Debug\GraphicsText.obj

     文件          0  2010-12-13 13:33  RayTracing\Debug\GraphicsText.sbr

............此处省略78个文件信息

评论

共有 条评论