검색어 입력폼

Cohen_Sutherland Assignment

저작시기 2015.06 |등록일 2018.02.03 파일확장자어도비 PDF (pdf) | 15페이지 | 가격 2,000원

목차

없음

본문내용

#define _CRT_SECURE_NO_WARNINGS // For using visual studio 2013
#include <stdio.h>
#include <GL/GLUT.h>
#include <Windows.h>
//Cohen Sutherland Code basically follows ABRL form.
#define ABOVE 0x8
#define BELOW 0x4
#define RIGHT 0x2
#define LEFT 0x1
int originalstate = 1; //To set the original mouse state
// Create the structure of (x,y) coordinate to use easily.
typedef struct{
double xpos;
double ypos;
}Coordinate;
//We are going to use (x,y) coordinate FREQUENTLY. That's why we made it.
Coordinate windowsize; //we need to set the window size for windowing
Coordinate wmin; //Minimum (x,y) value of window = left bottom edge
Coordinate wmax; //Maximum (x,y) value of window = right top edge
Coordinate p1, p2;
Coordinate startpt, finalpt;

//To represent each point in ABRL code
unsigned char ABRLcode(Coordinate p, Coordinate wmin, Coordinate wmax);
//To solve the x value which intersects with the window border.
double xsol(Coordinate p1, Coordinate p2, double x);
//To solve the y value which intersects with the window border.
double ysol(Coordinate p1, Coordinate p2, double x);

참고 자료

주우석(2014), OpenGL로 배우는 3차원 컴퓨터 그래픽스 , 한빛아카데미
Md Zia Uddin(2014), Computer Graphics Week 4 & Week 5 materials
openGL formal web site: https://www.opengl.org
다운로드 맨위로