Polygon Scan Conversion 计算机图形学高手帮忙哦 作业

Ahh_Freshmeat 2008-05-21 05:39:03

这个作业全是英文的,怎么做啊,高手帮帮忙,谢谢.

extended and used as part of the remaining programs, so
you should design it well.
You will read polygon descriptions in from a file in the format given
below. You should design a Polygon class to store the polygons into, and
then keep track of all of the polygons in your scene. Once all of the
polygons have been read in, you will then draw the filled polygons. A good
data structure design will assist you greatly in this assignment.
You should create a window that is 800 by 800 and allow for polygon
vertices to be any point lying in that range.
File Format
The file format that you will read from for this program is defined as
follows:
• Each polygon will be represented by three lines in a file.
• The first line will contain three integer values between 0 and 255,
representing the red, green, and blue components of the polygon
color. Store the basic color as part of the polygon object, to be
used when filling in the polygon.
• The second line will contain an integer that will specify the number
of vertices of the polygon.
• The third line will contain pairs of integer values representing
the (x, y) coordinates of the vertices.
For example, a sample file might look like:
0 255 0<- first polygon is green
4<- and has 4 vertices
50 50 100 200 400 100 10 350<- here are the 4 actual vertices
0 0 255<- second polygon is blue
3<- and has 3 vertices
500 10 20 400 350 350<- here are the 3 actual vertices

Extensibility Considerations
The extensions you will need to make for future programs (just so that
you can plan ahead) include:
1. Extending your system to deal with 3D polygons.
2. Comparing the Z value of each point in the polygon against another
Z value.
3. Computing a color for each point in the polygon. (Store a single
base color for the polygon that will be altered to allow for lighting
and shading.)
4. Adding other polygon material properties that we will discuss in
class.
...全文
152 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
Ahh_Freshmeat 2008-05-21
  • 打赏
  • 举报
回复
Overview
For this program you will build a 2D polygon fill routine. To do this,
you will implement the edge table technique and fill the polygon using
the OpenGL POINT primitive. You may not use POLYGON primitives. This
program will be extended and used as part of the remaining programs, so
you should design it well.

4,496

社区成员

发帖
与我相关
我的任务
社区描述
图形图像/机器视觉
社区管理员
  • 机器视觉
  • 迪菲赫尔曼
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧