first commit
This commit is contained in:
39
CS4451/proj4/Debug/BuildLog.htm
Normal file
39
CS4451/proj4/Debug/BuildLog.htm
Normal file
@@ -0,0 +1,39 @@
|
||||
<html>
|
||||
<head>
|
||||
<META HTTP-EQUIV="Content-Type" content="text/html; charset=Windows-1252">
|
||||
</head>
|
||||
<body>
|
||||
<pre>
|
||||
<table width=100% bgcolor=#CFCFE5><tr> <td> <font face=arial size=+3>
|
||||
Build Log
|
||||
</font></table><table width=* cellspacing=0 cellpadding=0><tr><td width=0 bgcolor=#EDEDF5> </td><td width=0 bgcolor=#FFFFFF> </td><td width=*><pre>
|
||||
<h3>------- Build started: Project: proj4, Configuration: Debug|Win32 -------
|
||||
</h3>
|
||||
</pre></table><table width=100% bgcolor=#DFDFE5><tr><td><font face=arial size=+2>
|
||||
Command Lines
|
||||
</font></table><table width=* cellspacing=0 cellpadding=0><tr><td width=0 bgcolor=#EDEDF5> </td><td width=0 bgcolor=#FFFFFF> </td><td width=*><pre>Creating temporary file "d:\School Shit\06 - 2005 - Spring\Cs4451\proj4\Debug\RSP00006D.rsp" with contents
|
||||
[
|
||||
/Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Gm /EHsc /RTC1 /MLd /Fo"Debug/" /Fd"Debug/vc70.pdb" /W3 /c /Wp64 /ZI /TP
|
||||
".\FileReader.cpp"
|
||||
]
|
||||
Creating command line "cl.exe @"d:\School Shit\06 - 2005 - Spring\Cs4451\proj4\Debug\RSP00006D.rsp" /nologo"
|
||||
Creating temporary file "d:\School Shit\06 - 2005 - Spring\Cs4451\proj4\Debug\RSP00006E.rsp" with contents
|
||||
[
|
||||
/OUT:"Debug/proj4.exe" /INCREMENTAL /NOLOGO /DEBUG /PDB:"Debug/proj4.pdb" /SUBSYSTEM:CONSOLE /MACHINE:X86 opengl32.lib glut32.lib glu32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib
|
||||
".\Debug\FileReader.obj"
|
||||
".\Debug\Input.obj"
|
||||
".\Debug\main.obj"
|
||||
".\Debug\Renderer.obj"
|
||||
]
|
||||
Creating command line "link.exe @"d:\School Shit\06 - 2005 - Spring\Cs4451\proj4\Debug\RSP00006E.rsp""
|
||||
</pre></table><table width=100% bgcolor=#DFDFE5><tr><td><font face=arial size=+2>
|
||||
Output Window
|
||||
</font></table><table width=* cellspacing=0 cellpadding=0><tr><td width=0 bgcolor=#EDEDF5> </td><td width=0 bgcolor=#FFFFFF> </td><td width=*><pre>Compiling...
|
||||
FileReader.cpp
|
||||
Linking...
|
||||
</pre></table><table width=100% bgcolor=#DFDFE5><tr><td><font face=arial size=+2>
|
||||
Results
|
||||
</font></table><table width=* cellspacing=0 cellpadding=0><tr><td width=0 bgcolor=#EDEDF5> </td><td width=0 bgcolor=#FFFFFF> </td><td width=*><pre>
|
||||
Build log was saved at "file://d:\School Shit\06 - 2005 - Spring\Cs4451\proj4\Debug\BuildLog.htm"
|
||||
proj4 - 0 error(s), 0 warning(s)</pre></table><table width=100% height=20 bgcolor=#CFCFE5><tr><td><font face=arial size=+2>
|
||||
</font></table></body></html>
|
||||
BIN
CS4451/proj4/Debug/FileReader.obj
Normal file
BIN
CS4451/proj4/Debug/FileReader.obj
Normal file
Binary file not shown.
BIN
CS4451/proj4/Debug/Input.obj
Normal file
BIN
CS4451/proj4/Debug/Input.obj
Normal file
Binary file not shown.
BIN
CS4451/proj4/Debug/Renderer.obj
Normal file
BIN
CS4451/proj4/Debug/Renderer.obj
Normal file
Binary file not shown.
BIN
CS4451/proj4/Debug/main.obj
Normal file
BIN
CS4451/proj4/Debug/main.obj
Normal file
Binary file not shown.
BIN
CS4451/proj4/Debug/proj4.exe
Normal file
BIN
CS4451/proj4/Debug/proj4.exe
Normal file
Binary file not shown.
BIN
CS4451/proj4/Debug/proj4.ilk
Normal file
BIN
CS4451/proj4/Debug/proj4.ilk
Normal file
Binary file not shown.
BIN
CS4451/proj4/Debug/proj4.pdb
Normal file
BIN
CS4451/proj4/Debug/proj4.pdb
Normal file
Binary file not shown.
BIN
CS4451/proj4/Debug/vc70.idb
Normal file
BIN
CS4451/proj4/Debug/vc70.idb
Normal file
Binary file not shown.
BIN
CS4451/proj4/Debug/vc70.pdb
Normal file
BIN
CS4451/proj4/Debug/vc70.pdb
Normal file
Binary file not shown.
173
CS4451/proj4/FileReader.cpp
Normal file
173
CS4451/proj4/FileReader.cpp
Normal file
@@ -0,0 +1,173 @@
|
||||
#include "FileReader.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <vector>
|
||||
#include <iostream>
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
#include <math.h>
|
||||
|
||||
//#include "defs.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
void FileReader::parseFile(Renderer &r) {
|
||||
parseFile(r.spheres,r.triangles,r.lights,&r.viewport,&r.h,&r.v,&r.l,r.ambient);
|
||||
}
|
||||
|
||||
void FileReader::parseFile(vector<Sphere*> *spheres,
|
||||
vector<Triangle*> *triangles, vector<Light*> *lights,
|
||||
Point *viewport, Point *h, Point *v, Point *l, m_float &ambient)
|
||||
{
|
||||
char *input = (char*) malloc(sizeof(char)*81);
|
||||
|
||||
//Skip the Image Dimensions, 800x800 is where its at
|
||||
cin.getline(input,81);
|
||||
//Viewpoint Location
|
||||
scanPoint(viewport,input);
|
||||
//l vector
|
||||
scanPoint(l,input);
|
||||
//h vector
|
||||
scanPoint(h,input);
|
||||
//v vector
|
||||
scanPoint(v,input);
|
||||
|
||||
//light source
|
||||
Light *light = new Light();//(Light*)malloc(sizeof(Light));
|
||||
scanLight(light,input);
|
||||
lights->push_back(light);
|
||||
|
||||
//Ambient Light intensity
|
||||
cin.getline(input,81);
|
||||
ambient = strtod(input, NULL);
|
||||
|
||||
//Get Primitives
|
||||
cin.getline(input,81);
|
||||
scanPrimitives(strtol(input,NULL,10), spheres, triangles, input);
|
||||
|
||||
}
|
||||
|
||||
void FileReader::scanPrimitives(int count, vector<Sphere*> *spheres,
|
||||
vector<Triangle*> *triangles, char *input)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < count; i++) {
|
||||
cin.getline(input,81);
|
||||
|
||||
switch (input[0]) {
|
||||
case 'S': {
|
||||
Sphere* sphere = new Sphere();
|
||||
|
||||
scanSphere(sphere,input);
|
||||
|
||||
spheres->push_back(sphere);
|
||||
|
||||
//sphere->printMe();
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case 'T': {
|
||||
Triangle* triangle = new Triangle();
|
||||
|
||||
scanTriangle(triangle,input);
|
||||
|
||||
triangles->push_back(triangle);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
cout << "Error bad\n";
|
||||
break;
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
void FileReader::scanMaterials(MaterialAttributes &attrib, char *input) {
|
||||
char *pEnd;
|
||||
|
||||
cin.getline(input,81);
|
||||
|
||||
attrib.k_dr = strtod(input,&pEnd);
|
||||
attrib.k_dg = strtod(pEnd,&pEnd);
|
||||
attrib.k_db = strtod(pEnd,&pEnd);
|
||||
attrib.k_ar = strtod(pEnd,&pEnd);
|
||||
attrib.k_ag = strtod(pEnd,&pEnd);
|
||||
attrib.k_ab = strtod(pEnd,&pEnd);
|
||||
attrib.k_s = strtod(pEnd,&pEnd);
|
||||
attrib.n_spec = strtod(pEnd,NULL);
|
||||
}
|
||||
|
||||
void FileReader::scanLight(Light *light, char *input) {
|
||||
char* pEnd;
|
||||
|
||||
cin.getline(input,81);
|
||||
light->center.x = strtod(input, &pEnd);
|
||||
light->center.y = strtod(pEnd, &pEnd);
|
||||
light->center.z = strtod(pEnd, &pEnd);
|
||||
|
||||
//For proper orientation
|
||||
if (Renderer::getInstance()->viewport.z - Renderer::getInstance()->l.z < 0) {
|
||||
light->center.x *= -1.;
|
||||
}
|
||||
|
||||
light->intensity = strtod(pEnd, NULL);
|
||||
}
|
||||
|
||||
void FileReader::scanSphere(Sphere *sphere, char *input) {
|
||||
//Sphere* sphere = new Sphere();
|
||||
|
||||
char *pEnd;
|
||||
|
||||
assert(sphere != NULL);
|
||||
|
||||
cin.getline(input,81);
|
||||
sphere->center.x = strtod(input, &pEnd);
|
||||
sphere->center.y = strtod(pEnd, &pEnd);
|
||||
sphere->center.z = strtod(pEnd, &pEnd);
|
||||
|
||||
if (Renderer::getInstance()->viewport.z - Renderer::getInstance()->l.z < 0) {
|
||||
sphere->center.x *= -1.;
|
||||
}
|
||||
|
||||
sphere->radius = fabs(strtod(pEnd,NULL));
|
||||
|
||||
scanMaterials(sphere->m_attr, input);
|
||||
|
||||
//primitives.push_back(sphere);
|
||||
}
|
||||
|
||||
void FileReader::scanTriangle(Triangle *triangle, char *input) {
|
||||
//Triangle* triangle = new Triangle();
|
||||
|
||||
assert(triangle != NULL);
|
||||
|
||||
scanPoint(&triangle->a1,input);
|
||||
scanPoint(&triangle->a2,input);
|
||||
scanPoint(&triangle->a3,input);
|
||||
|
||||
if (Renderer::getInstance()->viewport.z - Renderer::getInstance()->l.z < 0) {
|
||||
triangle->a1.x *= -1.;
|
||||
triangle->a2.x *= -1.;
|
||||
triangle->a3.x *= -1.;
|
||||
}
|
||||
|
||||
scanMaterials(triangle->m_attr, input);
|
||||
}
|
||||
|
||||
void FileReader::scanPoint(Point* point, char *input) {
|
||||
char* pEnd;
|
||||
|
||||
cin.getline(input, 81);
|
||||
point->x = strtod(input,&pEnd);
|
||||
point->y = strtod(pEnd,&pEnd);
|
||||
point->z = strtod(pEnd,NULL);
|
||||
|
||||
}
|
||||
34
CS4451/proj4/FileReader.h
Normal file
34
CS4451/proj4/FileReader.h
Normal file
@@ -0,0 +1,34 @@
|
||||
#ifndef _FILEREADER_H_
|
||||
#define _FILEREADER_H_
|
||||
|
||||
#include <vector>
|
||||
#include "defs.h"
|
||||
#include "structs.h"
|
||||
|
||||
#include "Renderer.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
/**
|
||||
* File Reader class
|
||||
*/
|
||||
class FileReader {
|
||||
public:
|
||||
void parseFile( vector<Sphere*> *spheres,
|
||||
vector<Triangle*> *triangles,
|
||||
vector<Light*> *lights,
|
||||
Point *viewport, Point *h, Point *v, Point *l, m_float &ambient);
|
||||
void parseFile(Renderer &r);
|
||||
|
||||
|
||||
private:
|
||||
void scanMaterials(MaterialAttributes &attrib, char* input);
|
||||
void scanLight(Light *light, char* input);
|
||||
void scanSphere(Sphere *sphere, char* input);
|
||||
void scanTriangle(Triangle *triangle, char* input);
|
||||
void scanPoint(Point *point, char* input);
|
||||
void scanPrimitives(int count, vector<Sphere*> *spheres,
|
||||
vector<Triangle*> *triangles, char *input);
|
||||
};
|
||||
|
||||
#endif
|
||||
165
CS4451/proj4/Input.cpp
Normal file
165
CS4451/proj4/Input.cpp
Normal file
@@ -0,0 +1,165 @@
|
||||
//#include <GL/glut.h>
|
||||
|
||||
#include "Input.h"
|
||||
#include "Renderer.h"
|
||||
#include "structs.h"
|
||||
#include "defs.h"
|
||||
|
||||
#include <math.h>
|
||||
|
||||
GLvoid menu ( int value ) {
|
||||
switch (value) {
|
||||
case MENU_SHADOWS:
|
||||
keyboard_event('a',0,0);
|
||||
break;
|
||||
case MENU_PRIMITIVES_ONLY:
|
||||
keyboard_event('p',0,0);
|
||||
break;
|
||||
case MENU_SHADOW_VOLUMES:
|
||||
keyboard_event('v',0,0);
|
||||
break;
|
||||
case MENU_CLEAR_WHITE:
|
||||
keyboard_event('x',0,0);
|
||||
break;
|
||||
case MENU_CLEAR_BLACK:
|
||||
keyboard_event('c',0,0);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
GLvoid keyboard_event(GLubyte key, GLint x, GLint y) {
|
||||
switch (key) {
|
||||
case 'w':
|
||||
*(Renderer::getInstance()->getViewAngle())-=.5;
|
||||
glutPostRedisplay();
|
||||
break;
|
||||
case 's':
|
||||
*(Renderer::getInstance()->getViewAngle())+=.5;
|
||||
glutPostRedisplay();
|
||||
break;
|
||||
case 'f':
|
||||
Renderer::getInstance()->backFaceCull = false;
|
||||
glCullFace(GL_FRONT);
|
||||
glutPostRedisplay();
|
||||
break;
|
||||
case 'b':
|
||||
Renderer::getInstance()->backFaceCull = true;
|
||||
glCullFace(GL_BACK);
|
||||
glutPostRedisplay();
|
||||
break;
|
||||
case 'p':
|
||||
Renderer::getInstance()->primitivesOnly = true;
|
||||
Renderer::getInstance()->drawShadows = false;
|
||||
glutPostRedisplay();
|
||||
break;
|
||||
case 'v':
|
||||
Renderer::getInstance()->drawShadows = false;
|
||||
Renderer::getInstance()->primitivesOnly = false;
|
||||
glutPostRedisplay();
|
||||
break;
|
||||
case 'a':
|
||||
Renderer::getInstance()->drawShadows = true;
|
||||
Renderer::getInstance()->primitivesOnly = false;
|
||||
glutPostRedisplay();
|
||||
break;
|
||||
case 'x':
|
||||
glClearColor(1,1,1,1.0);
|
||||
glutPostRedisplay();
|
||||
break;
|
||||
case 'c':
|
||||
glClearColor(0,0,0,1.0);
|
||||
glutPostRedisplay();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
/*
|
||||
* Convert screen coordinates to Trackball Coordinates
|
||||
*/
|
||||
inline void scalePoint(Point& p, GLint mx, GLint my) {
|
||||
m_int vpd = Renderer::getInstance()->getVPD();
|
||||
|
||||
//scale to -1 and 1
|
||||
float scale = ceil(vpd/2.);
|
||||
p.x = (mx / scale) -1.;
|
||||
p.y = (my / scale) -1.;
|
||||
p.y*=-1.; //handle reversed y
|
||||
|
||||
p.z = 1.-pow(p.x,2)-pow(p.y,2);
|
||||
|
||||
if (p.z < 0) {
|
||||
float under = sqrt((p.x*p.x)+(p.y*p.y));
|
||||
p.x /= under;
|
||||
p.y /= under;
|
||||
p.z = 0;
|
||||
} else {
|
||||
p.z = sqrt(p.z);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
GLvoid button_motion(GLint mx, GLint my) {
|
||||
Point scaledPoint;
|
||||
static Point oldPoint;
|
||||
|
||||
Light* light = Renderer::getInstance()->lights->front();
|
||||
|
||||
scalePoint(scaledPoint, mx, my);
|
||||
|
||||
|
||||
light->center.x = scaledPoint.x * Renderer::getInstance()->distanceToCenter.z;
|
||||
light->center.y = scaledPoint.y * Renderer::getInstance()->distanceToCenter.z;
|
||||
light->center.z = scaledPoint.z * Renderer::getInstance()->distanceToCenter.z;
|
||||
|
||||
if (Renderer::getInstance()->viewport.z - Renderer::getInstance()->l.z < 0) {
|
||||
light->center.y *= -1.;
|
||||
}
|
||||
|
||||
glutPostRedisplay();
|
||||
|
||||
}
|
||||
|
||||
GLvoid passive_motion(GLint mx, GLint my) {
|
||||
|
||||
}
|
||||
|
||||
GLvoid mouse_button(GLint btn, GLint state, GLint mx, GLint my) {
|
||||
|
||||
}
|
||||
|
||||
GLvoid keyboard_special_event(GLint key, GLint x, GLint y) {
|
||||
switch (key) {
|
||||
case GLUT_KEY_UP:
|
||||
Renderer::getInstance()->lights->front()->center.z+=.5;
|
||||
glutPostRedisplay();
|
||||
break;
|
||||
case GLUT_KEY_DOWN:
|
||||
Renderer::getInstance()->lights->front()->center.z-=.5;
|
||||
glutPostRedisplay();
|
||||
break;
|
||||
case GLUT_KEY_LEFT:
|
||||
Renderer::getInstance()->lights->front()->center.x+=.5;
|
||||
glutPostRedisplay();
|
||||
break;
|
||||
case GLUT_KEY_RIGHT:
|
||||
Renderer::getInstance()->lights->front()->center.x-=.5;
|
||||
glutPostRedisplay();
|
||||
break;
|
||||
case GLUT_KEY_PAGE_UP:
|
||||
Renderer::getInstance()->lights->front()->center.y+=.5;
|
||||
glutPostRedisplay();
|
||||
break;
|
||||
case GLUT_KEY_PAGE_DOWN:
|
||||
Renderer::getInstance()->lights->front()->center.y-=.5;
|
||||
glutPostRedisplay();
|
||||
break;
|
||||
}
|
||||
}
|
||||
18
CS4451/proj4/Input.h
Normal file
18
CS4451/proj4/Input.h
Normal file
@@ -0,0 +1,18 @@
|
||||
#ifndef _INPUT_H_
|
||||
#define _INPUT_H_
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <GL/glut.h>
|
||||
|
||||
#include "structs.h"
|
||||
|
||||
GLvoid menu ( int value );
|
||||
GLvoid keyboard_event(GLubyte key, GLint x, GLint y);
|
||||
GLvoid keyboard_special_event(GLint key, GLint x, GLint y);
|
||||
GLvoid button_motion(GLint mx, GLint my);
|
||||
GLvoid passive_motion(GLint mx, GLint my);
|
||||
GLvoid mouse_button(GLint btn, GLint state, GLint mx, GLint my);
|
||||
|
||||
//inline void scalePoint(Point& p, GLint mx, GLint my);
|
||||
|
||||
#endif
|
||||
41
CS4451/proj4/Makefile
Normal file
41
CS4451/proj4/Makefile
Normal file
@@ -0,0 +1,41 @@
|
||||
CC = g++
|
||||
#OPT = -Wno-deprecated -O3 -DSHOW_FPS
|
||||
OPT = -Wno-deprecated -O3 -D_NV_OPENGL
|
||||
LIBS = -L/usr/X11R6/lib -lglut -lGLU -lGL -lXmu -lXi -lX11 -lm
|
||||
SRC = main.cpp FileReader.cpp Renderer.cpp Input.cpp
|
||||
OBJ = main.o FileReader.o Renderer.o Input.o
|
||||
INCS = -I/usr/X11R6/include
|
||||
INC = FileReader.h Renderer.h Input.h structs.h defs.h
|
||||
TARGET = proj4
|
||||
MISC = Makefile
|
||||
|
||||
all: $(TARGET)
|
||||
|
||||
$(TARGET) : $(OBJ) $(MISC)
|
||||
$(CC) $(OPT) -o $(TARGET) $(INCS) $(OBJ) $(LIBS)
|
||||
|
||||
%.o : %.cpp $(MISC) $(INC)
|
||||
$(CC) $(OPT) $(INCS) -c -o $@ $<
|
||||
|
||||
clean:
|
||||
rm -f $(OBJ) $(TARGET)
|
||||
|
||||
|
||||
|
||||
#all : proj1
|
||||
|
||||
#proj1 : proj1.o functions.o image.o ray.o
|
||||
# $(CC) $(OPT) -o proj1 proj1.o functions.o $(LIBS)
|
||||
|
||||
#proj1.o : proj1.c defs.h
|
||||
# $(CC) $(OPT) -c proj1.c
|
||||
|
||||
#functions.o: functions.cpp defs.h functions.h
|
||||
# $(CC) $(OPT) -c functions.cpp
|
||||
|
||||
#image.o: image.cpp defs.h
|
||||
# $(CC) $(OPT) -c image.cpp
|
||||
|
||||
#clean:
|
||||
# rm *.o proj1
|
||||
|
||||
40
CS4451/proj4/Makefile_ATI
Normal file
40
CS4451/proj4/Makefile_ATI
Normal file
@@ -0,0 +1,40 @@
|
||||
CC = g++
|
||||
OPT = -Wno-deprecated -O3 -D_ATI_OPENGL
|
||||
LIBS = -L/usr/X11R6/lib -lglut -lGLU -lGL -lXmu -lXi -lX11 -lm
|
||||
SRC = main.cpp FileReader.cpp Renderer.cpp Input.cpp
|
||||
OBJ = main.o FileReader.o Renderer.o Input.o
|
||||
INCS = -I/usr/X11R6/include
|
||||
INC = FileReader.h Renderer.h Input.h structs.h defs.h
|
||||
TARGET = proj4
|
||||
MISC = Makefile
|
||||
|
||||
all: $(TARGET)
|
||||
|
||||
$(TARGET) : $(OBJ) $(MISC)
|
||||
$(CC) $(OPT) -o $(TARGET) $(INCS) $(OBJ) $(LIBS)
|
||||
|
||||
%.o : %.cpp $(MISC) $(INC)
|
||||
$(CC) $(OPT) $(INCS) -c -o $@ $<
|
||||
|
||||
clean:
|
||||
rm -f $(OBJ) $(TARGET)
|
||||
|
||||
|
||||
|
||||
#all : proj1
|
||||
|
||||
#proj1 : proj1.o functions.o image.o ray.o
|
||||
# $(CC) $(OPT) -o proj1 proj1.o functions.o $(LIBS)
|
||||
|
||||
#proj1.o : proj1.c defs.h
|
||||
# $(CC) $(OPT) -c proj1.c
|
||||
|
||||
#functions.o: functions.cpp defs.h functions.h
|
||||
# $(CC) $(OPT) -c functions.cpp
|
||||
|
||||
#image.o: image.cpp defs.h
|
||||
# $(CC) $(OPT) -c image.cpp
|
||||
|
||||
#clean:
|
||||
# rm *.o proj1
|
||||
|
||||
11
CS4451/proj4/README
Normal file
11
CS4451/proj4/README
Normal file
@@ -0,0 +1,11 @@
|
||||
Jose Caban - gtg184g
|
||||
Project 4
|
||||
|
||||
Notes:
|
||||
The Makefile is set to use Nvidia OpenGL rendering paramaters by default (as in states
|
||||
lab). The n_spec value and specular highlighting values are modified to output an image
|
||||
as close as possible to the raytracer output.
|
||||
|
||||
The most recent ATI drivers have issue with these settings that cause abnormal
|
||||
artifacts. Should these be a problem, please use make -f Makefile_ATI to build
|
||||
the application.
|
||||
31
CS4451/proj4/Release/BuildLog.htm
Normal file
31
CS4451/proj4/Release/BuildLog.htm
Normal file
@@ -0,0 +1,31 @@
|
||||
<html>
|
||||
<head>
|
||||
<META HTTP-EQUIV="Content-Type" content="text/html; charset=Windows-1252">
|
||||
</head>
|
||||
<body>
|
||||
<pre>
|
||||
<table width=100% bgcolor=#CFCFE5><tr> <td> <font face=arial size=+3>
|
||||
Build Log
|
||||
</font></table><table width=* cellspacing=0 cellpadding=0><tr><td width=0 bgcolor=#EDEDF5> </td><td width=0 bgcolor=#FFFFFF> </td><td width=*><pre>
|
||||
<h3>------- Build started: Project: proj4, Configuration: Release|Win32 -------
|
||||
</h3>
|
||||
</pre></table><table width=100% bgcolor=#DFDFE5><tr><td><font face=arial size=+2>
|
||||
Command Lines
|
||||
</font></table><table width=* cellspacing=0 cellpadding=0><tr><td width=0 bgcolor=#EDEDF5> </td><td width=0 bgcolor=#FFFFFF> </td><td width=*><pre>Creating temporary file "d:\School Shit\06 - 2005 - Spring\Cs4451\proj4\Release\RSP000002.rsp" with contents
|
||||
[
|
||||
/OUT:"Release/proj4.exe" /INCREMENTAL:NO /NOLOGO /DEBUG /PDB:"Release/proj4.pdb" /SUBSYSTEM:CONSOLE /OPT:REF /OPT:ICF /MACHINE:X86 opengl32.lib glut32.lib glu32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib
|
||||
".\Release\FileReader.obj"
|
||||
".\Release\Input.obj"
|
||||
".\Release\main.obj"
|
||||
".\Release\Renderer.obj"
|
||||
]
|
||||
Creating command line "link.exe @"d:\School Shit\06 - 2005 - Spring\Cs4451\proj4\Release\RSP000002.rsp""
|
||||
</pre></table><table width=100% bgcolor=#DFDFE5><tr><td><font face=arial size=+2>
|
||||
Output Window
|
||||
</font></table><table width=* cellspacing=0 cellpadding=0><tr><td width=0 bgcolor=#EDEDF5> </td><td width=0 bgcolor=#FFFFFF> </td><td width=*><pre>Linking...
|
||||
</pre></table><table width=100% bgcolor=#DFDFE5><tr><td><font face=arial size=+2>
|
||||
Results
|
||||
</font></table><table width=* cellspacing=0 cellpadding=0><tr><td width=0 bgcolor=#EDEDF5> </td><td width=0 bgcolor=#FFFFFF> </td><td width=*><pre>
|
||||
Build log was saved at "file://d:\School Shit\06 - 2005 - Spring\Cs4451\proj4\Release\BuildLog.htm"
|
||||
proj4 - 0 error(s), 0 warning(s)</pre></table><table width=100% height=20 bgcolor=#CFCFE5><tr><td><font face=arial size=+2>
|
||||
</font></table></body></html>
|
||||
BIN
CS4451/proj4/Release/FileReader.obj
Normal file
BIN
CS4451/proj4/Release/FileReader.obj
Normal file
Binary file not shown.
BIN
CS4451/proj4/Release/Input.obj
Normal file
BIN
CS4451/proj4/Release/Input.obj
Normal file
Binary file not shown.
BIN
CS4451/proj4/Release/Renderer.obj
Normal file
BIN
CS4451/proj4/Release/Renderer.obj
Normal file
Binary file not shown.
0
CS4451/proj4/Release/SmartShaderErrorLog.txt
Normal file
0
CS4451/proj4/Release/SmartShaderErrorLog.txt
Normal file
BIN
CS4451/proj4/Release/main.obj
Normal file
BIN
CS4451/proj4/Release/main.obj
Normal file
Binary file not shown.
BIN
CS4451/proj4/Release/proj4.exe
Normal file
BIN
CS4451/proj4/Release/proj4.exe
Normal file
Binary file not shown.
BIN
CS4451/proj4/Release/proj4.pdb
Normal file
BIN
CS4451/proj4/Release/proj4.pdb
Normal file
Binary file not shown.
BIN
CS4451/proj4/Release/vc70.idb
Normal file
BIN
CS4451/proj4/Release/vc70.idb
Normal file
Binary file not shown.
BIN
CS4451/proj4/Release/vc70.pdb
Normal file
BIN
CS4451/proj4/Release/vc70.pdb
Normal file
Binary file not shown.
799
CS4451/proj4/Renderer.cpp
Normal file
799
CS4451/proj4/Renderer.cpp
Normal file
@@ -0,0 +1,799 @@
|
||||
#include "Renderer.h"
|
||||
#include "defs.h"
|
||||
#include "structs.h"
|
||||
|
||||
#include <GL/glut.h>
|
||||
|
||||
#include <math.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include <time.h> //For FPS
|
||||
|
||||
#ifndef CLK_TCK
|
||||
#define CLK_TCK CLOCKS_PER_SEC
|
||||
#endif
|
||||
|
||||
#ifndef M_PI
|
||||
#define M_PI 3.14159265358979323846
|
||||
#endif
|
||||
|
||||
#define VPD_MIN 200
|
||||
#define VPD_DEFAULT 800
|
||||
#define VPD_MAX 1024
|
||||
|
||||
#ifndef max
|
||||
#define max(a,b) ( (a) > (b) ? (a) : (b) )
|
||||
#endif
|
||||
|
||||
#ifndef min
|
||||
#define min(a,b) ( (a) < (b) ? (a) : (b) )
|
||||
#endif
|
||||
|
||||
inline GLvoid reshape(GLint vpw, GLint vph) {
|
||||
Renderer::getInstance()->window_resize(vpw,vph);
|
||||
}
|
||||
|
||||
inline GLvoid draw() {
|
||||
if (!Renderer::getInstance()->drawShadows) {
|
||||
Renderer::getInstance()->render();
|
||||
} else {
|
||||
Renderer::getInstance()->renderWithShadows();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Renderer Renderer::instance;
|
||||
Renderer * Renderer::getInstance()
|
||||
{
|
||||
return & instance;
|
||||
}
|
||||
|
||||
|
||||
Renderer::Renderer() {
|
||||
|
||||
spheres = new vector<Sphere*>;
|
||||
triangles = new vector<Triangle*>;
|
||||
lights = new vector<Light*>;
|
||||
|
||||
this->vpd = VPD_DEFAULT;
|
||||
this->viewAngle = -1.;
|
||||
|
||||
lightCenter = gluNewQuadric();
|
||||
|
||||
this->primitivesOnly = true;
|
||||
this->drawShadows = true;
|
||||
this->backFaceCull = true;
|
||||
|
||||
}
|
||||
|
||||
Renderer::~Renderer() {
|
||||
delete spheres;
|
||||
delete triangles;
|
||||
delete lights;
|
||||
}
|
||||
|
||||
void Renderer::apply_attributes(MaterialAttributes attrib, float alpha) {
|
||||
GLfloat mat_specular[4] = { attrib.k_s, attrib.k_s, attrib.k_s, alpha };
|
||||
//GLfloat mat_ambient_and_diffuse[4] = { 0.5, 0.5, 0.5, 1.0 };
|
||||
GLfloat mat_ambient[4] = { attrib.k_ar, attrib.k_ag, attrib.k_ab, alpha };
|
||||
GLfloat mat_diffuse[4] = { attrib.k_dr, attrib.k_dg, attrib.k_db, alpha };
|
||||
|
||||
#ifdef _NV_OPENGL
|
||||
GLfloat mat_shininess[1] = { (attrib.n_spec * 5. ) };
|
||||
#else //_ATI_OPENGL
|
||||
GLfloat mat_shininess[1] = { (attrib.n_spec) };
|
||||
#endif
|
||||
|
||||
/*mat_specular[0] = mat_ambient_and_diffuse[0] = r;
|
||||
mat_specular[1] = mat_ambient_and_diffuse[1] = g;
|
||||
mat_specular[2] = mat_ambient_and_diffuse[2] = b;*/
|
||||
|
||||
glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, mat_specular);
|
||||
glMaterialfv(GL_FRONT_AND_BACK, GL_SHININESS, mat_shininess);
|
||||
glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, mat_ambient);
|
||||
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mat_diffuse);
|
||||
}
|
||||
|
||||
GLvoid Renderer::init_lightsource ( GLvoid )
|
||||
{
|
||||
Light l = *(Renderer::getInstance()->lights->front());
|
||||
|
||||
//Light 0 parameters
|
||||
GLfloat light_diffuse[] = { l.intensity, l.intensity, l.intensity, 1.0 };
|
||||
#ifdef _NV_OPENGL
|
||||
GLfloat light_specular[] = { 1.0, 1.0, 1.0, 1.0 };
|
||||
#else //_ATI_OPENGL
|
||||
GLfloat light_specular[] = { l.intensity, l.intensity, l.intensity, 1.0 };
|
||||
#endif
|
||||
|
||||
GLfloat light_position[] = { l.center.x, l.center.y, l.center.z, 0 };
|
||||
|
||||
//Set Light 0 properties
|
||||
glLightfv(GL_LIGHT0, GL_DIFFUSE, light_diffuse);
|
||||
glLightfv(GL_LIGHT0, GL_SPECULAR, light_specular);
|
||||
glLightfv(GL_LIGHT0, GL_POSITION, light_position);
|
||||
glLightf(GL_LIGHT0,GL_CONSTANT_ATTENUATION,1.0);
|
||||
glLightf(GL_LIGHT0,GL_LINEAR_ATTENUATION,0.0);
|
||||
glLightf(GL_LIGHT0,GL_QUADRATIC_ATTENUATION,0.0);
|
||||
|
||||
//Enable light0
|
||||
glEnable(GL_LIGHT0);
|
||||
}
|
||||
|
||||
void Renderer::fixVertexDirection(Triangle* t) {
|
||||
|
||||
if (checkTriangle(t,viewport)) {
|
||||
Point temp = t->a2;
|
||||
t->a2 = t->a3;
|
||||
t->a3 = temp;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes the Triangle sceneID
|
||||
* Initializes all the Sphere quadrics
|
||||
* Sets the view angle
|
||||
*/
|
||||
void Renderer::init_scene() {
|
||||
triangleScene = glGenLists(1);
|
||||
|
||||
glNewList(triangleScene,GL_COMPILE);
|
||||
|
||||
glBegin(GL_TRIANGLES);
|
||||
|
||||
vector<Triangle*>::iterator t_iterator = triangles->begin();
|
||||
Triangle *t;
|
||||
Point normal;
|
||||
Point lightCenter;
|
||||
|
||||
for(;t_iterator != triangles->end(); t_iterator++) {
|
||||
t = *t_iterator;
|
||||
|
||||
fixVertexDirection(t);
|
||||
|
||||
apply_attributes(t->m_attr);
|
||||
|
||||
this->calculateNormal(&normal,t);
|
||||
|
||||
lightCenter = (lights->front())->center;
|
||||
|
||||
if (this->checkTriNormal(normal,lightCenter)) {
|
||||
glNormal3f(-normal.x,-normal.y,-normal.z);
|
||||
} else {
|
||||
glNormal3f(normal.x,normal.y,normal.z);
|
||||
}
|
||||
|
||||
glVertex3f(t->a1.x,t->a1.y,t->a1.z);
|
||||
glVertex3f(t->a2.x,t->a2.y,t->a2.z);
|
||||
glVertex3f(t->a3.x,t->a3.y,t->a3.z);
|
||||
}
|
||||
|
||||
glEnd();
|
||||
|
||||
//glEndList();*/
|
||||
|
||||
|
||||
|
||||
vector<Sphere*>::iterator s_iter = spheres->begin();
|
||||
for (; s_iter != spheres->end(); s_iter++) {
|
||||
apply_attributes((*s_iter)->m_attr);
|
||||
(*s_iter)->glSphere = gluNewQuadric();
|
||||
gluQuadricOrientation((*s_iter)->glSphere,GLU_OUTSIDE);
|
||||
|
||||
glPushMatrix();
|
||||
glTranslatef((*s_iter)->center.x, (*s_iter)->center.y, (*s_iter)->center.z);
|
||||
gluSphere((*s_iter)->glSphere, (*s_iter)->radius, 64, 64);
|
||||
glPopMatrix();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
glEndList();
|
||||
|
||||
|
||||
//Initialize the view
|
||||
this->viewAngle = 2.*(180./M_PI)*
|
||||
atan(fabs(viewport.y - l.y) / fabs(viewport.z - l.z));
|
||||
|
||||
//printf("viewAngle: %f\n",viewAngle);
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* returns true if the light and the normal are on opposite sides
|
||||
*/
|
||||
bool Renderer::checkTriNormal(Point normal, Point lightCenter) {
|
||||
return (
|
||||
(lightCenter.x*normal.x) +
|
||||
(lightCenter.y*normal.y) +
|
||||
(lightCenter.z*normal.z) < 0);
|
||||
}
|
||||
|
||||
void Renderer::calculateNormal(Point *dest, Triangle* triangle) {
|
||||
Point a1a2, a1a3;
|
||||
Point a1 = triangle->a1, a2 = triangle->a2, a3 = triangle->a3;
|
||||
|
||||
a1a2.x = a2.x - a1.x;
|
||||
a1a2.y = a2.y - a1.y;
|
||||
a1a2.z = a2.z - a1.z;
|
||||
|
||||
a1a3.x = a3.x - a1.x;
|
||||
a1a3.y = a3.y - a1.y;
|
||||
a1a3.z = a3.z - a1.z;
|
||||
|
||||
Point::cross(*dest,a1a2,a1a3);
|
||||
|
||||
}
|
||||
|
||||
bool Renderer::checkTriangle(Triangle* triangle, Point lightCenter) {
|
||||
Point normal;
|
||||
|
||||
this->calculateNormal(&normal,triangle);
|
||||
return checkTriNormal(normal,lightCenter);
|
||||
}
|
||||
|
||||
void Renderer::getVector(Point *dest, Point *to, Point *from) {
|
||||
dest->x = to->x - from->x;
|
||||
dest->y = to->y - from->y;
|
||||
dest->z = to->z - from->z;
|
||||
}
|
||||
|
||||
void Renderer::generateTriangleShadows() {
|
||||
vector<Triangle*>::iterator t_iter = triangles->begin();
|
||||
Triangle* t;
|
||||
for (int i =0; t_iter != triangles->end(); t_iter++, i++) {
|
||||
|
||||
t = *t_iter;
|
||||
|
||||
Light light = *(lights->front());
|
||||
|
||||
|
||||
//TODO: MAKE A QUAD STRIP!
|
||||
|
||||
Point la1, la2, la3;
|
||||
|
||||
getVector(&la1,&t->a1,&light.center);
|
||||
getVector(&la2,&t->a2,&light.center);
|
||||
getVector(&la3,&t->a3,&light.center);
|
||||
|
||||
glBegin(GL_QUADS);
|
||||
|
||||
if (!checkTriangle(t,light.center)) {
|
||||
|
||||
/*
|
||||
a1' a1 a3 a3'
|
||||
a3' a3 a2 a2'
|
||||
a2' a2 a1 a1'
|
||||
*/
|
||||
|
||||
glVertex4f(la1.x, la1.y, la1.z, 0);
|
||||
glVertex3f(t->a1.x,t->a1.y,t->a1.z);
|
||||
glVertex3f(t->a3.x,t->a3.y,t->a3.z);
|
||||
glVertex4f(la3.x, la3.y, la3.z, 0);
|
||||
|
||||
glVertex4f(la3.x, la3.y, la3.z, 0);
|
||||
glVertex3f(t->a3.x,t->a3.y,t->a3.z);
|
||||
glVertex3f(t->a2.x,t->a2.y,t->a2.z);
|
||||
glVertex4f(la2.x, la2.y, la2.z, 0);
|
||||
|
||||
glVertex4f(la2.x, la2.y, la2.z, 0);
|
||||
glVertex3f(t->a2.x,t->a2.y,t->a2.z);
|
||||
glVertex3f(t->a1.x,t->a1.y,t->a1.z);
|
||||
glVertex4f(la1.x, la1.y, la1.z, 0);
|
||||
|
||||
} else {
|
||||
/*
|
||||
a1 a1' a3' a3
|
||||
a3 a3' a2' a2
|
||||
a2 a2' a1' a1
|
||||
*/
|
||||
|
||||
glColor3d(1, 0, 0);
|
||||
glVertex3f(t->a1.x,t->a1.y,t->a1.z);
|
||||
glVertex4f(la1.x, la1.y, la1.z, 0);
|
||||
glVertex4f(la3.x, la3.y, la3.z, 0);
|
||||
glVertex3f(t->a3.x,t->a3.y,t->a3.z);
|
||||
|
||||
glVertex3f(t->a3.x,t->a3.y,t->a3.z);
|
||||
glVertex4f(la3.x, la3.y, la3.z, 0);
|
||||
glVertex4f(la2.x, la2.y, la2.z, 0);
|
||||
glVertex3f(t->a2.x,t->a2.y,t->a2.z);
|
||||
|
||||
glVertex3f(t->a2.x,t->a2.y,t->a2.z);
|
||||
glVertex4f(la2.x, la2.y, la2.z, 0);
|
||||
glVertex4f(la1.x, la1.y, la1.z, 0);
|
||||
glVertex3f(t->a1.x,t->a1.y,t->a1.z);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
glEnd();
|
||||
}
|
||||
}
|
||||
|
||||
static inline Point wB(m_float B, Point& u, Point& v) {
|
||||
Point temp1,temp2;
|
||||
Point::mul(temp1,v,cos(B));
|
||||
Point::mul(temp2,u,sin(B));
|
||||
Point::add(temp1,temp1,temp2);
|
||||
return temp1;
|
||||
}
|
||||
|
||||
void Renderer::generateSphereShadows() {
|
||||
Light* light = this->lights->front();
|
||||
Point PL, LP, LC, temp, P, u, v;
|
||||
vector<Sphere*>::iterator s_iter;
|
||||
Sphere* s;
|
||||
m_float radius;
|
||||
|
||||
|
||||
glBegin(GL_QUADS);
|
||||
|
||||
for (s_iter = spheres->begin();
|
||||
s_iter != spheres->end();
|
||||
s_iter++)
|
||||
{
|
||||
s = *s_iter;
|
||||
|
||||
//LC
|
||||
Point::sub(LC,s->center,light->center);
|
||||
|
||||
m_float LClen = LC.magnitude();
|
||||
m_float PLlen = (pow(LClen,2) - pow(s->radius,2))/LClen;
|
||||
|
||||
radius = sqrt(pow(LC.magnitude(),2)
|
||||
- pow(s->radius,2) - pow(PLlen,2));//PL.magnitude(),2));
|
||||
|
||||
//printf("Radius %f\n",radius);
|
||||
|
||||
temp = Point::normalize(LC);
|
||||
Point::mul(temp, temp, PLlen);
|
||||
Point::add(P,light->center,temp);
|
||||
|
||||
//P.printMe();
|
||||
|
||||
if (fabs(LC.z) > fabs(LC.x)) {
|
||||
if (fabs(LC.x) > fabs(LC.y)) {
|
||||
u.x = -1. * LC.z;
|
||||
u.y = 0;
|
||||
u.z = LC.x;
|
||||
} else { //LC.x < LC.y
|
||||
u.x = 0;
|
||||
u.y = LC.z * -1.;
|
||||
u.z = LC.y;
|
||||
}
|
||||
} else { //|LC.z| < |LC.x|
|
||||
if (fabs(LC.z) > fabs(LC.y)) {
|
||||
u.x = -1. * LC.z;
|
||||
u.y = 0;
|
||||
u.z = LC.x;
|
||||
} else { //LC.z < LC.y
|
||||
u.x = -1. * LC.y;
|
||||
u.y = LC.x;
|
||||
u.z = 0;
|
||||
}
|
||||
}
|
||||
|
||||
Point::mul(u,Point::normalize(u),radius);
|
||||
//u.printMe();
|
||||
//printf("length %f\n",u.magnitude());
|
||||
Point::cross(v,u,LC);
|
||||
Point::mul(v,Point::normalize(v),radius);
|
||||
|
||||
Point Q, Q2;
|
||||
Point Qb, Q2b;
|
||||
|
||||
for (int k = 0; k < 64; k++) {
|
||||
Point::add(Q, P,wB((k*2*M_PI) / 64,u,v));
|
||||
Point::add(Q2,P,wB(((k+1)*2*M_PI) / 64,u,v));
|
||||
|
||||
//Q.printMe();
|
||||
|
||||
getVector(&Qb, &Q, &light->center);
|
||||
getVector(&Q2b, &Q2, &light->center);
|
||||
|
||||
//Q.printMe();
|
||||
glVertex4f(Qb.x, Qb.y, Qb.z, 0);
|
||||
glVertex3f(Q.x,Q.y,Q.z);
|
||||
glVertex3f(Q2.x,Q2.y,Q2.z);
|
||||
glVertex4f(Q2b.x, Q2b.y, Q2b.z, 0);
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
glEnd();
|
||||
|
||||
}
|
||||
|
||||
m_uint Renderer::calculateShadowVolumes() {
|
||||
|
||||
apply_attributes(this->m_shadow_attrib,.2f);
|
||||
|
||||
generateTriangleShadows();
|
||||
generateSphereShadows();
|
||||
|
||||
//glEndList();
|
||||
return 0;//shadows;
|
||||
}
|
||||
|
||||
void Renderer::drawPrimitives(bool withLight) {
|
||||
|
||||
/* Do project fux0ring */
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
|
||||
//Set the perspective transformation
|
||||
gluPerspective(viewAngle,h.x/v.y,1,150);
|
||||
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glLoadIdentity();
|
||||
|
||||
//Look at the right point in the world
|
||||
gluLookAt(viewport.x,viewport.y,viewport.z,
|
||||
viewport.x,viewport.y,l.z,
|
||||
v.x,v.y,v.z);
|
||||
|
||||
if (withLight) {
|
||||
init_lightsource();
|
||||
}
|
||||
glCallList(triangleScene);
|
||||
|
||||
//GLuint shadows = this->calculateShadowVolumes();
|
||||
//glDeleteLists(shadows,1);
|
||||
|
||||
/*vector<Sphere*>::iterator s_iter = spheres->begin();
|
||||
Sphere *s;
|
||||
for(int i = 0 ;s_iter != spheres->end();i++, s_iter++) {
|
||||
|
||||
s = *s_iter;
|
||||
|
||||
glPushMatrix();
|
||||
|
||||
apply_attributes(s->m_attr);
|
||||
|
||||
glTranslatef(s->center.x,s->center.y,s->center.z);
|
||||
gluSphere(s->glSphere,s->radius,64,64);
|
||||
|
||||
glPopMatrix();
|
||||
|
||||
}*/
|
||||
}
|
||||
|
||||
void Renderer::renderWithShadows(void) {
|
||||
/* ensure we're drawing to the correct GLUT window */
|
||||
glutSetWindow(wid);
|
||||
|
||||
/*
|
||||
* Clear all buffers
|
||||
*/
|
||||
|
||||
/* clear the color buffers */
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
|
||||
|
||||
|
||||
/********************************************************************/
|
||||
/* Step 2 - Draw the scene, no lighting only primitives and abience */
|
||||
|
||||
//Disable the LightSource
|
||||
glDisable(GL_LIGHT0);
|
||||
glDisable(GL_STENCIL_TEST);
|
||||
|
||||
//Enable Backface culling
|
||||
glEnable(GL_CULL_FACE);
|
||||
if (this->backFaceCull) {
|
||||
glCullFace(GL_BACK);
|
||||
} else {
|
||||
glCullFace(GL_FRONT);
|
||||
}
|
||||
//glCullFace(GL_BACK);
|
||||
|
||||
//Depth test to Less than or Equal
|
||||
glDepthFunc(GL_LEQUAL);
|
||||
|
||||
//Draw the Primitives
|
||||
drawPrimitives(false);
|
||||
|
||||
glFlush();
|
||||
|
||||
/*****************************************************/
|
||||
/* Step 3 - Draw the shadow Polys with BackFace cull */
|
||||
|
||||
//Read only Depth and Color
|
||||
glDepthMask(0);
|
||||
glColorMask(0,0,0,0);
|
||||
|
||||
//Stencil Buffer writeable
|
||||
//glStencilMask(1);
|
||||
|
||||
//Stencil paramaters
|
||||
glEnable(GL_STENCIL_TEST);
|
||||
glStencilOp(GL_KEEP,GL_KEEP,GL_INCR);
|
||||
glStencilFunc(GL_ALWAYS,0,~0);
|
||||
|
||||
/*glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
gluPerspective(viewAngle,h.x/v.y,1,150);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glLoadIdentity();
|
||||
gluLookAt(viewport.x,viewport.y,viewport.z,
|
||||
viewport.x,viewport.y,l.z,
|
||||
v.x,v.y,v.z);*/
|
||||
|
||||
//Draw Shadow Volumes
|
||||
this->calculateShadowVolumes();
|
||||
|
||||
glFlush();
|
||||
|
||||
/*****************************************************/
|
||||
/* Step 4 - Draw the shadow Polys with FrontFace cull */
|
||||
|
||||
//Front face culling
|
||||
glCullFace(GL_FRONT);
|
||||
|
||||
//Stencil Decrements
|
||||
glStencilOp(GL_KEEP,GL_KEEP,GL_DECR);
|
||||
glStencilFunc(GL_ALWAYS,0,~0);
|
||||
|
||||
/*glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
gluPerspective(viewAngle,h.x/v.y,1,150);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glLoadIdentity();
|
||||
gluLookAt(viewport.x,viewport.y,viewport.z,
|
||||
viewport.x,viewport.y,l.z,
|
||||
v.x,v.y,v.z);*/
|
||||
|
||||
this->calculateShadowVolumes();
|
||||
|
||||
glFlush();
|
||||
|
||||
/*************************************/
|
||||
/* Step 5 - Draw the fully lit scene */
|
||||
|
||||
glEnable(GL_STENCIL_TEST);
|
||||
glStencilFunc(GL_EQUAL, 0, ~0);
|
||||
glStencilOp(GL_KEEP,GL_KEEP,GL_KEEP);
|
||||
|
||||
glDepthFunc(GL_LEQUAL);
|
||||
|
||||
if (this->backFaceCull) {
|
||||
glCullFace(GL_BACK);
|
||||
} else {
|
||||
glCullFace(GL_FRONT);
|
||||
}
|
||||
|
||||
glDepthMask(1);
|
||||
glColorMask(1,1,1,1);
|
||||
|
||||
glEnable(GL_LIGHT0);
|
||||
|
||||
this->drawPrimitives(true);
|
||||
|
||||
glDisable(GL_STENCIL_TEST);
|
||||
//glDeleteLists(shadows,1);
|
||||
|
||||
glFlush();
|
||||
|
||||
/* look at our handiwork */
|
||||
glutSwapBuffers();
|
||||
|
||||
#ifdef SHOW_FPS
|
||||
fps++;
|
||||
//printf("%d\n",fps);
|
||||
clock_t time = clock();
|
||||
if (time-lastClock >= CLK_TCK) {
|
||||
printf("Rendered %d frames in %f seconds\n",
|
||||
fps,(time-lastClock)/(float)CLK_TCK);
|
||||
lastClock = clock();
|
||||
fps = 0;
|
||||
}
|
||||
glutPostRedisplay();
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
void Renderer::render(void)
|
||||
{
|
||||
/* ensure we're drawing to the correct GLUT window */
|
||||
glutSetWindow(wid);
|
||||
|
||||
/* clear the color buffers */
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
|
||||
|
||||
drawPrimitives(true);
|
||||
|
||||
if (!this->primitivesOnly) {
|
||||
this->calculateShadowVolumes();
|
||||
}
|
||||
|
||||
/* flush the pipeline */
|
||||
glFlush();
|
||||
|
||||
/* look at our handiwork */
|
||||
glutSwapBuffers();
|
||||
|
||||
#ifdef SHOW_FPS
|
||||
fps++;
|
||||
//printf("%d\n",fps);
|
||||
clock_t time = clock();
|
||||
if (time-lastClock >= CLK_TCK) {
|
||||
printf("Rendered %d frames in %f seconds\n",
|
||||
fps,(time-lastClock)/(float)CLK_TCK);
|
||||
lastClock = clock();
|
||||
fps = 0;
|
||||
}
|
||||
glutPostRedisplay();
|
||||
#endif
|
||||
|
||||
//glutPostRedisplay();
|
||||
|
||||
}
|
||||
|
||||
void Renderer::init_opengl() {
|
||||
/* back-face culling on */
|
||||
glEnable(GL_CULL_FACE);
|
||||
glCullFace(GL_BACK); /* We want to cull the back */
|
||||
glFrontFace(GL_CCW);
|
||||
/*if (viewport.z - l.z < 0) {
|
||||
glFrontFace(GL_CW);
|
||||
} else {
|
||||
glFrontFace(GL_CCW);
|
||||
}*/
|
||||
|
||||
/* automatically scale normals to unit length after transformation */
|
||||
glEnable(GL_NORMALIZE);
|
||||
|
||||
//Enable Lighting
|
||||
glEnable(GL_LIGHTING);
|
||||
|
||||
/* clear to BLACK */
|
||||
glClearColor(0, 0, 0, 1.0);
|
||||
glClearStencil(0);
|
||||
|
||||
/* Enable depth test */
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
|
||||
//Global parameter
|
||||
GLfloat light_ambient[] = { ambient, ambient, ambient, 1.0 };
|
||||
|
||||
//Set global ambience
|
||||
glLightModelfv(GL_LIGHT_MODEL_AMBIENT, light_ambient);
|
||||
|
||||
//glPolygonMode(GL_FRONT_AND_BACK,GL_LINE);
|
||||
|
||||
//glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE);
|
||||
}
|
||||
|
||||
GLvoid Renderer::window_resize(GLint vpw, GLint vph)
|
||||
{
|
||||
glutSetWindow(wid);
|
||||
|
||||
/* maintain a square viewport, not too small, not too big */
|
||||
if( vpw < vph ) vpd = vph;
|
||||
else vpd = vpw;
|
||||
|
||||
if( vpd < VPD_MIN ) vpd = VPD_MIN;
|
||||
if( vpd > VPD_MAX ) vpd = VPD_MAX;
|
||||
|
||||
glViewport(0, 0, vpd, vpd);
|
||||
glutReshapeWindow(vpd, vpd);
|
||||
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
m_int Renderer::init_glut(m_int *argc, char **argv)
|
||||
{
|
||||
m_int id;
|
||||
|
||||
glutInit(argc,argv);
|
||||
|
||||
/* size and placement hints to the window system */
|
||||
glutInitWindowSize(vpd, vpd);
|
||||
glutInitWindowPosition(10,10);
|
||||
|
||||
/* double buffered, RGB color mode */
|
||||
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH | GLUT_STENCIL);
|
||||
|
||||
/* create a GLUT window (not drawn until glutMainLoop() is entered) */
|
||||
id = glutCreateWindow("cs4451 project 4: Super Cool Shadows!");
|
||||
|
||||
/* register callbacks */
|
||||
|
||||
/* window size changes */
|
||||
//glutReshapeFunc(NULL);
|
||||
glutReshapeFunc(reshape);
|
||||
|
||||
/* keypress handling when the current window has input focus */
|
||||
glutKeyboardFunc(keyboard_event);
|
||||
|
||||
/* mouse event handling */
|
||||
glutMouseFunc(mouse_button); /* button press/release */
|
||||
glutMotionFunc(button_motion); /* mouse motion w/ button down */
|
||||
glutPassiveMotionFunc(passive_motion); /* mouse motion with button up */
|
||||
|
||||
/* window obscured/revealed event handler */
|
||||
glutVisibilityFunc(NULL);
|
||||
|
||||
/* handling of keyboard SHIFT, ALT, CTRL keys */
|
||||
glutSpecialFunc(keyboard_special_event);
|
||||
|
||||
/* what to do when mouse cursor enters/exits the current window */
|
||||
glutEntryFunc(NULL);
|
||||
|
||||
/* what to do on each display loop iteration */
|
||||
glutDisplayFunc(draw);
|
||||
|
||||
/* Create the menu */
|
||||
|
||||
//Create the Zoom Menu
|
||||
GLint menuID = glutCreateMenu(menu);
|
||||
glutAddMenuEntry("Show Shadows (a)",MENU_SHADOWS);
|
||||
glutAddMenuEntry("Show Primitives Only (p)",MENU_PRIMITIVES_ONLY);
|
||||
glutAddMenuEntry("Show Shadow Volumes (v)",MENU_SHADOW_VOLUMES);
|
||||
glutAddMenuEntry("Clear to White (x)",MENU_CLEAR_WHITE);
|
||||
glutAddMenuEntry("Clear to Black (c)",MENU_CLEAR_BLACK);
|
||||
|
||||
glutSetMenu(menuID);
|
||||
|
||||
glutAttachMenu(GLUT_RIGHT_BUTTON);
|
||||
|
||||
return id;
|
||||
}
|
||||
|
||||
void Renderer::calculateDistance() {
|
||||
Point distances;
|
||||
m_float total = 0;
|
||||
|
||||
vector<Sphere*>::iterator s_iter;
|
||||
vector<Triangle*>::iterator t_iter;
|
||||
Point centerOfMass;
|
||||
|
||||
for (s_iter = spheres->begin();
|
||||
s_iter != spheres->end();
|
||||
s_iter++)
|
||||
{
|
||||
distances.x += this->viewport.x - (*s_iter)->center.x;
|
||||
distances.y += this->viewport.y - (*s_iter)->center.y;
|
||||
distances.z += this->viewport.z - (*s_iter)->center.z;
|
||||
total++;
|
||||
}
|
||||
|
||||
for (t_iter = triangles->begin();
|
||||
t_iter != triangles->end();
|
||||
t_iter++)
|
||||
{
|
||||
centerOfMass = this->centerOfTriangle(*t_iter);
|
||||
distances.x += this->viewport.x - centerOfMass.x;
|
||||
distances.y += this->viewport.y - centerOfMass.y;
|
||||
distances.z += this->viewport.z - centerOfMass.z;
|
||||
total++;
|
||||
}
|
||||
|
||||
distances.x /= total;
|
||||
distances.y /= total;
|
||||
distances.z /= total;
|
||||
|
||||
this->distanceToCenter = distances;
|
||||
|
||||
//distances.printMe();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
122
CS4451/proj4/Renderer.h
Normal file
122
CS4451/proj4/Renderer.h
Normal file
@@ -0,0 +1,122 @@
|
||||
#ifndef _RENDERER_H_
|
||||
#define _RENDERER_H_
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <GL/glut.h>
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "structs.h"
|
||||
#include "defs.h"
|
||||
#include "Input.h"
|
||||
|
||||
#include <time.h> //For FPS
|
||||
|
||||
using namespace std;
|
||||
|
||||
class Renderer {
|
||||
public:
|
||||
|
||||
static Renderer* getInstance();
|
||||
|
||||
vector<Sphere*> *spheres;
|
||||
vector<Triangle*> *triangles;
|
||||
vector<Light*> *lights;
|
||||
|
||||
Point viewport;
|
||||
Point h;
|
||||
Point v;
|
||||
Point l;
|
||||
|
||||
m_float ambient;
|
||||
|
||||
GLvoid window_resize(GLint vpw, GLint vph);
|
||||
void render(void);
|
||||
void renderWithShadows(void);
|
||||
|
||||
inline void init(int *argc, char** argv) {
|
||||
this->wid = init_glut(argc,argv);
|
||||
init_opengl();
|
||||
init_scene();
|
||||
this->calculateDistance();
|
||||
lastClock = clock();
|
||||
fps = 0;
|
||||
}
|
||||
|
||||
void init_scene();
|
||||
|
||||
m_float* getViewAngle() {
|
||||
return &viewAngle;
|
||||
}
|
||||
|
||||
bool drawShadows;
|
||||
bool primitivesOnly;
|
||||
|
||||
bool backFaceCull;
|
||||
|
||||
inline m_int getVPD() { return this->vpd; }
|
||||
|
||||
Point distanceToCenter;
|
||||
|
||||
private:
|
||||
|
||||
static Renderer instance;
|
||||
MaterialAttributes m_shadow_attrib;
|
||||
|
||||
GLUquadricObj* lightCenter;
|
||||
|
||||
Renderer();
|
||||
~Renderer();
|
||||
|
||||
float frontClippingPlane;
|
||||
float rearClippingPlane;
|
||||
|
||||
m_int vpd;
|
||||
m_int wid;
|
||||
|
||||
m_float viewAngle;
|
||||
|
||||
m_uint triangleScene;
|
||||
|
||||
clock_t fps;
|
||||
clock_t lastClock;
|
||||
|
||||
|
||||
void init_opengl();
|
||||
m_int init_glut(m_int *argc, char** argv);
|
||||
|
||||
void apply_attributes(MaterialAttributes attrib, float alpha);
|
||||
inline void apply_attributes(MaterialAttributes attrib) {
|
||||
apply_attributes(attrib,1.0f);
|
||||
}
|
||||
|
||||
GLvoid init_lightsource( GLvoid );
|
||||
|
||||
bool checkTriNormal(Point normal, Point lightCenter);
|
||||
bool checkTriangle(Triangle* triangle, Point lightCenter);
|
||||
void calculateNormal(Point *dest, Triangle* triangle);
|
||||
|
||||
m_uint calculateShadowVolumes();
|
||||
|
||||
void fixVertexDirection(Triangle* t);
|
||||
|
||||
void drawPrimitives(bool withLight);
|
||||
|
||||
void getVector(Point* dest, Point* to, Point* from);
|
||||
|
||||
void calculateDistance();
|
||||
|
||||
inline Point centerOfTriangle(Triangle* t) {
|
||||
Point p;
|
||||
p.x = ( t->a1.x + t->a2.x + t->a3.x ) / 3.;
|
||||
p.y = ( t->a1.y + t->a2.y + t->a3.y ) / 3.;
|
||||
p.z = ( t->a1.z + t->a2.z + t->a3.z ) / 3.;
|
||||
return p;
|
||||
}
|
||||
|
||||
void generateTriangleShadows();
|
||||
void generateSphereShadows();
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
0
CS4451/proj4/Sphere.cpp
Normal file
0
CS4451/proj4/Sphere.cpp
Normal file
13
CS4451/proj4/defs.h
Normal file
13
CS4451/proj4/defs.h
Normal file
@@ -0,0 +1,13 @@
|
||||
#ifndef _DEFS_H_
|
||||
#define _DEFS_H_
|
||||
|
||||
#include <GL/glut.h>
|
||||
|
||||
typedef GLfloat m_float; //Let's precision be quickly changed
|
||||
typedef GLint m_int;
|
||||
typedef GLuint m_uint;
|
||||
|
||||
enum { MENU_SHADOWS, MENU_SHADOW_VOLUMES, MENU_PRIMITIVES_ONLY,
|
||||
MENU_CLEAR_WHITE, MENU_CLEAR_BLACK };
|
||||
|
||||
#endif
|
||||
20
CS4451/proj4/input/input1.txt
Normal file
20
CS4451/proj4/input/input1.txt
Normal file
@@ -0,0 +1,20 @@
|
||||
512 512
|
||||
0 0 -40
|
||||
-1 -1 -30
|
||||
2 0 0
|
||||
0 2 0
|
||||
100 100 -100 1
|
||||
1
|
||||
4
|
||||
S
|
||||
2 2 3 2
|
||||
.4 0 0 .2 0 0 .4 50
|
||||
S
|
||||
-2 -2 3 2
|
||||
.4 0 0 .2 0 0 .4 2
|
||||
S
|
||||
2 -2 3 2
|
||||
.4 0 0 .2 0 0 .4 10
|
||||
S
|
||||
-2 2 3 2
|
||||
.4 0 0 .2 0 0 .4 100
|
||||
48
CS4451/proj4/input/input10.txt
Normal file
48
CS4451/proj4/input/input10.txt
Normal file
@@ -0,0 +1,48 @@
|
||||
512 512
|
||||
0 0 20
|
||||
-1 -1 1
|
||||
2 0 0
|
||||
0 2 0
|
||||
1.5 0.5 10 0.8
|
||||
0.2
|
||||
12
|
||||
T
|
||||
0.99 -1 -1
|
||||
-0.99 -1 -1
|
||||
-0.99 1 -1
|
||||
1 1 1 1 1 1 0 1
|
||||
T
|
||||
0.99 -1 -1
|
||||
-0.99 1 -1
|
||||
0.99 1 -1
|
||||
1 1 1 1 1 1 0 1
|
||||
S
|
||||
-0.227881 0.0368164 0.58335 0.128076
|
||||
1 1 0 1 1 0 0 1
|
||||
S
|
||||
0.500195 -0.513525 -0.130127 0.14541
|
||||
0 1 1 0 1 1 0 1
|
||||
S
|
||||
0.343408 0.443066 0.571289 0.272363
|
||||
1 0 1 1 0 1 0 1
|
||||
S
|
||||
0.340234 -0.309131 0.072998 0.316309
|
||||
1 1 1 1 1 1 0 1
|
||||
S
|
||||
0.292627 -0.588428 -0.127588 0.325098
|
||||
1 0 0 1 0 0 0 1
|
||||
S
|
||||
-0.603662 0.293896 -0.0558594 0.139795
|
||||
0 1 0 0 1 0 0 1
|
||||
S
|
||||
0.484326 0.1479 0.594141 0.281885
|
||||
0 0 1 0 0 1 0 1
|
||||
S
|
||||
-0.112988 0.519873 0.524316 0.262842
|
||||
1 1 0 1 1 0 0 1
|
||||
S
|
||||
-0.00888672 -0.24502 0.576367 0.240869
|
||||
1 0 1 1 0 1 0 1
|
||||
S
|
||||
0.564307 0.253906 -0.3104 0.115137
|
||||
0 0 1 0 0 1 0 1
|
||||
11
CS4451/proj4/input/input11.txt
Normal file
11
CS4451/proj4/input/input11.txt
Normal file
@@ -0,0 +1,11 @@
|
||||
512 512
|
||||
0 0 20
|
||||
-1 -1 1
|
||||
2 0 0
|
||||
0 2 0
|
||||
10 10 10 0.8
|
||||
0.2
|
||||
1
|
||||
S
|
||||
0 0 0 0.5
|
||||
1 1 0 1 1 0 0 1
|
||||
23
CS4451/proj4/input/input12.txt
Normal file
23
CS4451/proj4/input/input12.txt
Normal file
@@ -0,0 +1,23 @@
|
||||
512 512
|
||||
0 0 20
|
||||
-1 -1 1
|
||||
2 0 0
|
||||
0 2 0
|
||||
10 3 2 0.8
|
||||
0.2
|
||||
5
|
||||
S
|
||||
0.5 0.5 0 0.45
|
||||
1 0 0 1 0 0 0 1
|
||||
S
|
||||
0.5 -0.5 0 0.45
|
||||
0 1 0 0 1 0 0 1
|
||||
S
|
||||
-0.5 0.5 0 0.45
|
||||
0 0 1 0 0 1 0 1
|
||||
S
|
||||
-0.5 -0.5 0 0.45
|
||||
1 1 1 1 1 1 0 1
|
||||
S
|
||||
0 0 0 0.4
|
||||
1 1 0 1 1 0 0 1
|
||||
11
CS4451/proj4/input/input13.txt
Normal file
11
CS4451/proj4/input/input13.txt
Normal file
@@ -0,0 +1,11 @@
|
||||
512 512
|
||||
0 0 20
|
||||
-1 -1 1
|
||||
2 0 0
|
||||
0 2 0
|
||||
10 10 10 0.8
|
||||
0.2
|
||||
1
|
||||
S
|
||||
0 0 0 1
|
||||
1 1 0 1 1 0 0 1
|
||||
38
CS4451/proj4/input/input14.txt
Normal file
38
CS4451/proj4/input/input14.txt
Normal file
@@ -0,0 +1,38 @@
|
||||
512 512
|
||||
0 0 20
|
||||
-1 -1 1
|
||||
2 0 0
|
||||
0 2 0
|
||||
1.5 0.5 1.1 0.8
|
||||
0.2
|
||||
10
|
||||
S
|
||||
-0.262939 0.0424805 0.673096 0.104211
|
||||
0.0791016 0.249023 0.0722656 0.0791016 0.249023 0.0722656 0 1
|
||||
S
|
||||
0.577148 -0.592529 -0.150146 0.106812
|
||||
0.916992 0.486328 0.745117 0.916992 0.486328 0.745117 0 1
|
||||
S
|
||||
0.39624 0.51123 0.65918 0.125854
|
||||
0.0820312 0.992188 0.776367 0.0820312 0.992188 0.776367 0 1
|
||||
S
|
||||
0.392578 -0.356689 0.0842285 0.132446
|
||||
0.337891 0.294922 0.59668 0.337891 0.294922 0.59668 0 1
|
||||
S
|
||||
0.337646 -0.678955 -0.147217 0.133765
|
||||
0.849609 0.298828 0.0126953 0.849609 0.298828 0.0126953 0 1
|
||||
S
|
||||
-0.696533 0.339111 -0.0644531 0.105969
|
||||
0.337891 0.286133 0.34082 0.337891 0.286133 0.34082 0 1
|
||||
S
|
||||
0.558838 0.170654 0.685547 0.127283
|
||||
0.0917969 0.207031 0.416992 0.0917969 0.207031 0.416992 0 1
|
||||
S
|
||||
-0.130371 0.599854 0.60498 0.124426
|
||||
0.675781 0.0820312 0.516602 0.675781 0.0820312 0.516602 0 1
|
||||
S
|
||||
-0.0102539 -0.282715 0.665039 0.12113
|
||||
0.282227 0.30957 0.464844 0.282227 0.30957 0.464844 0 1
|
||||
S
|
||||
0.651123 0.292969 -0.358154 0.102271
|
||||
0.157227 0.563477 0.219727 0.157227 0.563477 0.219727 0 1
|
||||
68
CS4451/proj4/input/input15.txt
Normal file
68
CS4451/proj4/input/input15.txt
Normal file
@@ -0,0 +1,68 @@
|
||||
512 512
|
||||
0 0 20
|
||||
-1 -1 1
|
||||
2 0 0
|
||||
0 2 0
|
||||
1.5 0.5 1.1 0.8
|
||||
0.2
|
||||
20
|
||||
S
|
||||
-0.262939 0.0424805 0.673096 0.104211
|
||||
0.0791016 0.249023 0.0722656 0.0791016 0.249023 0.0722656 0 1
|
||||
S
|
||||
0.577148 -0.592529 -0.150146 0.106812
|
||||
0.916992 0.486328 0.745117 0.916992 0.486328 0.745117 0 1
|
||||
S
|
||||
0.39624 0.51123 0.65918 0.125854
|
||||
0.0820312 0.992188 0.776367 0.0820312 0.992188 0.776367 0 1
|
||||
S
|
||||
0.392578 -0.356689 0.0842285 0.132446
|
||||
0.337891 0.294922 0.59668 0.337891 0.294922 0.59668 0 1
|
||||
S
|
||||
0.337646 -0.678955 -0.147217 0.133765
|
||||
0.849609 0.298828 0.0126953 0.849609 0.298828 0.0126953 0 1
|
||||
S
|
||||
-0.696533 0.339111 -0.0644531 0.105969
|
||||
0.337891 0.286133 0.34082 0.337891 0.286133 0.34082 0 1
|
||||
S
|
||||
0.558838 0.170654 0.685547 0.127283
|
||||
0.0917969 0.207031 0.416992 0.0917969 0.207031 0.416992 0 1
|
||||
S
|
||||
-0.130371 0.599854 0.60498 0.124426
|
||||
0.675781 0.0820312 0.516602 0.675781 0.0820312 0.516602 0 1
|
||||
S
|
||||
-0.0102539 -0.282715 0.665039 0.12113
|
||||
0.282227 0.30957 0.464844 0.282227 0.30957 0.464844 0 1
|
||||
S
|
||||
0.651123 0.292969 -0.358154 0.102271
|
||||
0.157227 0.563477 0.219727 0.157227 0.563477 0.219727 0 1
|
||||
S
|
||||
-0.37207 0.112061 0.32959 0.128162
|
||||
0.623047 0.647461 0.478516 0.623047 0.647461 0.478516 0 1
|
||||
S
|
||||
0.213867 0.109131 -0.672363 0.133362
|
||||
0.0546875 0.0898438 0.541016 0.0546875 0.0898438 0.541016 0 1
|
||||
S
|
||||
0.202148 -0.128906 -0.0432129 0.127942
|
||||
0.548828 0.170898 0.308594 0.548828 0.170898 0.308594 0 1
|
||||
S
|
||||
-0.624023 0.389648 0.169922 0.136145
|
||||
0.0898438 0.251953 0.0253906 0.0898438 0.251953 0.0253906 0 1
|
||||
S
|
||||
0.563965 0.138428 0.566162 0.127905
|
||||
0.666016 0.806641 0.495117 0.666016 0.806641 0.495117 0 1
|
||||
S
|
||||
-0.217529 -0.340576 -0.730957 0.100183
|
||||
0.308594 0.871094 0.894531 0.308594 0.871094 0.894531 0 1
|
||||
S
|
||||
-0.273193 -0.720703 -0.32666 0.103552
|
||||
0.133789 0.493164 0.839844 0.133789 0.493164 0.839844 0 1
|
||||
S
|
||||
-0.511963 -0.498047 -0.112061 0.119299
|
||||
0.145508 0.922852 0.479492 0.145508 0.922852 0.479492 0 1
|
||||
S
|
||||
-0.176514 0.618896 -0.378662 0.118127
|
||||
0.991211 0.75 0.227539 0.991211 0.75 0.227539 0 1
|
||||
S
|
||||
0.25708 0.33252 0.207275 0.135522
|
||||
0.0107422 0.698242 0.953125 0.0107422 0.698242 0.953125 0 1
|
||||
158
CS4451/proj4/input/input16.txt
Normal file
158
CS4451/proj4/input/input16.txt
Normal file
@@ -0,0 +1,158 @@
|
||||
512 512
|
||||
0 0 20
|
||||
-1 -1 1
|
||||
2 0 0
|
||||
0 2 0
|
||||
1.5 0.5 1.1 0.8
|
||||
0.2
|
||||
50
|
||||
S
|
||||
-0.262939 0.0424805 0.673096 0.104211
|
||||
0.0791016 0.249023 0.0722656 0.0791016 0.249023 0.0722656 0 1
|
||||
S
|
||||
0.577148 -0.592529 -0.150146 0.106812
|
||||
0.916992 0.486328 0.745117 0.916992 0.486328 0.745117 0 1
|
||||
S
|
||||
0.39624 0.51123 0.65918 0.125854
|
||||
0.0820312 0.992188 0.776367 0.0820312 0.992188 0.776367 0 1
|
||||
S
|
||||
0.392578 -0.356689 0.0842285 0.132446
|
||||
0.337891 0.294922 0.59668 0.337891 0.294922 0.59668 0 1
|
||||
S
|
||||
0.337646 -0.678955 -0.147217 0.133765
|
||||
0.849609 0.298828 0.0126953 0.849609 0.298828 0.0126953 0 1
|
||||
S
|
||||
-0.696533 0.339111 -0.0644531 0.105969
|
||||
0.337891 0.286133 0.34082 0.337891 0.286133 0.34082 0 1
|
||||
S
|
||||
0.558838 0.170654 0.685547 0.127283
|
||||
0.0917969 0.207031 0.416992 0.0917969 0.207031 0.416992 0 1
|
||||
S
|
||||
-0.130371 0.599854 0.60498 0.124426
|
||||
0.675781 0.0820312 0.516602 0.675781 0.0820312 0.516602 0 1
|
||||
S
|
||||
-0.0102539 -0.282715 0.665039 0.12113
|
||||
0.282227 0.30957 0.464844 0.282227 0.30957 0.464844 0 1
|
||||
S
|
||||
0.651123 0.292969 -0.358154 0.102271
|
||||
0.157227 0.563477 0.219727 0.157227 0.563477 0.219727 0 1
|
||||
S
|
||||
-0.37207 0.112061 0.32959 0.128162
|
||||
0.623047 0.647461 0.478516 0.623047 0.647461 0.478516 0 1
|
||||
S
|
||||
0.213867 0.109131 -0.672363 0.133362
|
||||
0.0546875 0.0898438 0.541016 0.0546875 0.0898438 0.541016 0 1
|
||||
S
|
||||
0.202148 -0.128906 -0.0432129 0.127942
|
||||
0.548828 0.170898 0.308594 0.548828 0.170898 0.308594 0 1
|
||||
S
|
||||
-0.624023 0.389648 0.169922 0.136145
|
||||
0.0898438 0.251953 0.0253906 0.0898438 0.251953 0.0253906 0 1
|
||||
S
|
||||
0.563965 0.138428 0.566162 0.127905
|
||||
0.666016 0.806641 0.495117 0.666016 0.806641 0.495117 0 1
|
||||
S
|
||||
-0.217529 -0.340576 -0.730957 0.100183
|
||||
0.308594 0.871094 0.894531 0.308594 0.871094 0.894531 0 1
|
||||
S
|
||||
-0.273193 -0.720703 -0.32666 0.103552
|
||||
0.133789 0.493164 0.839844 0.133789 0.493164 0.839844 0 1
|
||||
S
|
||||
-0.511963 -0.498047 -0.112061 0.119299
|
||||
0.145508 0.922852 0.479492 0.145508 0.922852 0.479492 0 1
|
||||
S
|
||||
-0.176514 0.618896 -0.378662 0.118127
|
||||
0.991211 0.75 0.227539 0.991211 0.75 0.227539 0 1
|
||||
S
|
||||
0.25708 0.33252 0.207275 0.135522
|
||||
0.0107422 0.698242 0.953125 0.0107422 0.698242 0.953125 0 1
|
||||
S
|
||||
0.509766 0.322998 -0.635742 0.125671
|
||||
0.530273 0.28418 0.779297 0.530273 0.28418 0.779297 0 1
|
||||
S
|
||||
-0.498047 -0.583008 -0.465088 0.113037
|
||||
0.442383 0.769531 0.862305 0.442383 0.769531 0.862305 0 1
|
||||
S
|
||||
-0.440918 0.230713 0.493652 0.130872
|
||||
0.868164 0.84668 0.307617 0.868164 0.84668 0.307617 0 1
|
||||
S
|
||||
-0.644531 -0.448242 -0.401367 0.119373
|
||||
0.154297 0.258789 0.464844 0.154297 0.258789 0.464844 0 1
|
||||
S
|
||||
0.625488 0.0322266 0.436523 0.118237
|
||||
0.526367 0.265625 0.170898 0.526367 0.265625 0.170898 0 1
|
||||
S
|
||||
0.706787 -0.412354 -0.712646 0.127063
|
||||
0.328125 0.570312 0.0693359 0.328125 0.570312 0.0693359 0 1
|
||||
S
|
||||
0.172119 0.495117 -0.699463 0.11344
|
||||
0.0332031 0.274414 0.181641 0.0332031 0.274414 0.181641 0 1
|
||||
S
|
||||
-0.676025 0.658447 -0.366943 0.128528
|
||||
0.719727 0.0253906 0.277344 0.719727 0.0253906 0.277344 0 1
|
||||
S
|
||||
-0.655518 -0.213135 0.193359 0.101501
|
||||
0.242188 0.160156 0.526367 0.242188 0.160156 0.526367 0 1
|
||||
S
|
||||
-0.576416 -0.320068 0.227051 0.130981
|
||||
0.976562 0.648438 0.548828 0.976562 0.648438 0.548828 0 1
|
||||
S
|
||||
0.521484 0.585938 0.286377 0.10282
|
||||
0.55957 0.550781 0.433594 0.55957 0.550781 0.433594 0 1
|
||||
S
|
||||
-0.44458 0.130371 0.287842 0.11853
|
||||
0.948242 0.105469 0.254883 0.948242 0.105469 0.254883 0 1
|
||||
S
|
||||
0.249023 -0.0981445 -0.39917 0.120325
|
||||
0.416016 0.275391 0.583008 0.416016 0.275391 0.583008 0 1
|
||||
S
|
||||
0.256348 -0.32666 -0.0820312 0.116003
|
||||
0.862305 0.807617 0.253906 0.862305 0.807617 0.253906 0 1
|
||||
S
|
||||
-0.629883 0.407959 -0.602051 0.10542
|
||||
0.674805 0.420898 0.220703 0.674805 0.420898 0.220703 0 1
|
||||
S
|
||||
-0.175781 0.0205078 0.259277 0.131018
|
||||
0.798828 0.270508 0.321289 0.798828 0.270508 0.321289 0 1
|
||||
S
|
||||
0.189697 -0.282715 -0.432129 0.115564
|
||||
0.507812 0.109375 0.957031 0.507812 0.109375 0.957031 0 1
|
||||
S
|
||||
0.0571289 -0.288574 0.344971 0.121826
|
||||
0.820312 0.650391 0.00976562 0.820312 0.650391 0.00976562 0 1
|
||||
S
|
||||
-0.512695 -0.343506 0.552246 0.119629
|
||||
0.914062 0.0664062 0.667969 0.914062 0.0664062 0.667969 0 1
|
||||
S
|
||||
0.30835 0.384521 0.0834961 0.130908
|
||||
0.459961 0.543945 0.651367 0.459961 0.543945 0.651367 0 1
|
||||
S
|
||||
-0.194092 0.13916 0.0197754 0.10022
|
||||
0.191406 0.549805 0.420898 0.191406 0.549805 0.420898 0 1
|
||||
S
|
||||
0.224854 -0.494385 -0.28418 0.123401
|
||||
0.0439453 0.918945 0.207031 0.0439453 0.918945 0.207031 0 1
|
||||
S
|
||||
-0.648926 -0.427002 -0.162598 0.120581
|
||||
0.0273438 0.480469 0.0722656 0.0273438 0.480469 0.0722656 0 1
|
||||
S
|
||||
0.0439453 -0.410156 0.194824 0.119922
|
||||
0.0341797 0.629883 0.355469 0.0341797 0.629883 0.355469 0 1
|
||||
S
|
||||
-0.371338 -0.130371 0.744873 0.128271
|
||||
0.988281 0.980469 0.760742 0.988281 0.980469 0.760742 0 1
|
||||
S
|
||||
0.614502 -0.398438 0.61377 0.133032
|
||||
0.19043 0.560547 0.504883 0.19043 0.560547 0.504883 0 1
|
||||
S
|
||||
0.573486 -0.360352 -0.533936 0.103772
|
||||
0.0498047 0.928711 0.649414 0.0498047 0.928711 0.649414 0 1
|
||||
S
|
||||
0.691406 0.443115 0.20874 0.100732
|
||||
0.956055 0.461914 0.550781 0.956055 0.461914 0.550781 0 1
|
||||
S
|
||||
-0.743408 -0.0688477 -0.679688 0.118237
|
||||
0.265625 0.914062 0.240234 0.265625 0.914062 0.240234 0 1
|
||||
S
|
||||
0.558838 0.0791016 -0.000732422 0.116333
|
||||
0.425781 0.183594 0.316406 0.425781 0.183594 0.316406 0 1
|
||||
68
CS4451/proj4/input/input17.txt
Normal file
68
CS4451/proj4/input/input17.txt
Normal file
@@ -0,0 +1,68 @@
|
||||
512 512
|
||||
0 0 20
|
||||
-1 -1 1
|
||||
2 0 0
|
||||
0 2 0
|
||||
1.5 0.5 1.1 0.8
|
||||
0.2
|
||||
20
|
||||
S
|
||||
-0.227881 0.0368164 0.58335 0.128076
|
||||
0.0791016 0.249023 0.0722656 0.0791016 0.249023 0.0722656 0 1
|
||||
S
|
||||
0.500195 -0.513525 -0.130127 0.14541
|
||||
0.916992 0.486328 0.745117 0.916992 0.486328 0.745117 0 1
|
||||
S
|
||||
0.343408 0.443066 0.571289 0.272363
|
||||
0.0820312 0.992188 0.776367 0.0820312 0.992188 0.776367 0 1
|
||||
S
|
||||
0.340234 -0.309131 0.072998 0.316309
|
||||
0.337891 0.294922 0.59668 0.337891 0.294922 0.59668 0 1
|
||||
S
|
||||
0.292627 -0.588428 -0.127588 0.325098
|
||||
0.849609 0.298828 0.0126953 0.849609 0.298828 0.0126953 0 1
|
||||
S
|
||||
-0.603662 0.293896 -0.0558594 0.139795
|
||||
0.337891 0.286133 0.34082 0.337891 0.286133 0.34082 0 1
|
||||
S
|
||||
0.484326 0.1479 0.594141 0.281885
|
||||
0.0917969 0.207031 0.416992 0.0917969 0.207031 0.416992 0 1
|
||||
S
|
||||
-0.112988 0.519873 0.524316 0.262842
|
||||
0.675781 0.0820312 0.516602 0.675781 0.0820312 0.516602 0 1
|
||||
S
|
||||
-0.00888672 -0.24502 0.576367 0.240869
|
||||
0.282227 0.30957 0.464844 0.282227 0.30957 0.464844 0 1
|
||||
S
|
||||
0.564307 0.253906 -0.3104 0.115137
|
||||
0.157227 0.563477 0.219727 0.157227 0.563477 0.219727 0 1
|
||||
S
|
||||
-0.322461 0.0971191 0.285645 0.287744
|
||||
0.623047 0.647461 0.478516 0.623047 0.647461 0.478516 0 1
|
||||
S
|
||||
0.185352 0.0945801 -0.582715 0.322412
|
||||
0.0546875 0.0898438 0.541016 0.0546875 0.0898438 0.541016 0 1
|
||||
S
|
||||
0.175195 -0.111719 -0.0374512 0.286279
|
||||
0.548828 0.170898 0.308594 0.548828 0.170898 0.308594 0 1
|
||||
S
|
||||
-0.54082 0.337695 0.147266 0.340967
|
||||
0.0898438 0.251953 0.0253906 0.0898438 0.251953 0.0253906 0 1
|
||||
S
|
||||
0.48877 0.119971 0.490674 0.286035
|
||||
0.666016 0.806641 0.495117 0.666016 0.806641 0.495117 0 1
|
||||
S
|
||||
-0.188525 -0.295166 -0.633496 0.101221
|
||||
0.308594 0.871094 0.894531 0.308594 0.871094 0.894531 0 1
|
||||
S
|
||||
-0.236768 -0.624609 -0.283105 0.123682
|
||||
0.133789 0.493164 0.839844 0.133789 0.493164 0.839844 0 1
|
||||
S
|
||||
-0.443701 -0.431641 -0.0971191 0.228662
|
||||
0.145508 0.922852 0.479492 0.145508 0.922852 0.479492 0 1
|
||||
S
|
||||
-0.152979 0.536377 -0.328174 0.22085
|
||||
0.991211 0.75 0.227539 0.991211 0.75 0.227539 0 1
|
||||
S
|
||||
0.222803 0.288184 0.179639 0.336816
|
||||
0.0107422 0.698242 0.953125 0.0107422 0.698242 0.953125 0 1
|
||||
158
CS4451/proj4/input/input18.txt
Normal file
158
CS4451/proj4/input/input18.txt
Normal file
@@ -0,0 +1,158 @@
|
||||
512 512
|
||||
0 0 20
|
||||
-1 -1 1
|
||||
2 0 0
|
||||
0 2 0
|
||||
1.5 0.5 1.1 0.8
|
||||
0.2
|
||||
50
|
||||
S
|
||||
-0.227881 0.0368164 0.58335 0.128076
|
||||
0.0791016 0.249023 0.0722656 0.0791016 0.249023 0.0722656 0 1
|
||||
S
|
||||
0.500195 -0.513525 -0.130127 0.14541
|
||||
0.916992 0.486328 0.745117 0.916992 0.486328 0.745117 0 1
|
||||
S
|
||||
0.343408 0.443066 0.571289 0.272363
|
||||
0.0820312 0.992188 0.776367 0.0820312 0.992188 0.776367 0 1
|
||||
S
|
||||
0.340234 -0.309131 0.072998 0.316309
|
||||
0.337891 0.294922 0.59668 0.337891 0.294922 0.59668 0 1
|
||||
S
|
||||
0.292627 -0.588428 -0.127588 0.325098
|
||||
0.849609 0.298828 0.0126953 0.849609 0.298828 0.0126953 0 1
|
||||
S
|
||||
-0.603662 0.293896 -0.0558594 0.139795
|
||||
0.337891 0.286133 0.34082 0.337891 0.286133 0.34082 0 1
|
||||
S
|
||||
0.484326 0.1479 0.594141 0.281885
|
||||
0.0917969 0.207031 0.416992 0.0917969 0.207031 0.416992 0 1
|
||||
S
|
||||
-0.112988 0.519873 0.524316 0.262842
|
||||
0.675781 0.0820312 0.516602 0.675781 0.0820312 0.516602 0 1
|
||||
S
|
||||
-0.00888672 -0.24502 0.576367 0.240869
|
||||
0.282227 0.30957 0.464844 0.282227 0.30957 0.464844 0 1
|
||||
S
|
||||
0.564307 0.253906 -0.3104 0.115137
|
||||
0.157227 0.563477 0.219727 0.157227 0.563477 0.219727 0 1
|
||||
S
|
||||
-0.322461 0.0971191 0.285645 0.287744
|
||||
0.623047 0.647461 0.478516 0.623047 0.647461 0.478516 0 1
|
||||
S
|
||||
0.185352 0.0945801 -0.582715 0.322412
|
||||
0.0546875 0.0898438 0.541016 0.0546875 0.0898438 0.541016 0 1
|
||||
S
|
||||
0.175195 -0.111719 -0.0374512 0.286279
|
||||
0.548828 0.170898 0.308594 0.548828 0.170898 0.308594 0 1
|
||||
S
|
||||
-0.54082 0.337695 0.147266 0.340967
|
||||
0.0898438 0.251953 0.0253906 0.0898438 0.251953 0.0253906 0 1
|
||||
S
|
||||
0.48877 0.119971 0.490674 0.286035
|
||||
0.666016 0.806641 0.495117 0.666016 0.806641 0.495117 0 1
|
||||
S
|
||||
-0.188525 -0.295166 -0.633496 0.101221
|
||||
0.308594 0.871094 0.894531 0.308594 0.871094 0.894531 0 1
|
||||
S
|
||||
-0.236768 -0.624609 -0.283105 0.123682
|
||||
0.133789 0.493164 0.839844 0.133789 0.493164 0.839844 0 1
|
||||
S
|
||||
-0.443701 -0.431641 -0.0971191 0.228662
|
||||
0.145508 0.922852 0.479492 0.145508 0.922852 0.479492 0 1
|
||||
S
|
||||
-0.152979 0.536377 -0.328174 0.22085
|
||||
0.991211 0.75 0.227539 0.991211 0.75 0.227539 0 1
|
||||
S
|
||||
0.222803 0.288184 0.179639 0.336816
|
||||
0.0107422 0.698242 0.953125 0.0107422 0.698242 0.953125 0 1
|
||||
S
|
||||
0.441797 0.279932 -0.550977 0.271143
|
||||
0.530273 0.28418 0.779297 0.530273 0.28418 0.779297 0 1
|
||||
S
|
||||
-0.431641 -0.505273 -0.403076 0.186914
|
||||
0.442383 0.769531 0.862305 0.442383 0.769531 0.862305 0 1
|
||||
S
|
||||
-0.382129 0.199951 0.427832 0.305811
|
||||
0.868164 0.84668 0.307617 0.868164 0.84668 0.307617 0 1
|
||||
S
|
||||
-0.558594 -0.388477 -0.347852 0.22915
|
||||
0.154297 0.258789 0.464844 0.154297 0.258789 0.464844 0 1
|
||||
S
|
||||
0.54209 0.0279297 0.37832 0.221582
|
||||
0.526367 0.265625 0.170898 0.526367 0.265625 0.170898 0 1
|
||||
S
|
||||
0.612549 -0.357373 -0.617627 0.28042
|
||||
0.328125 0.570312 0.0693359 0.328125 0.570312 0.0693359 0 1
|
||||
S
|
||||
0.14917 0.429102 -0.606201 0.1896
|
||||
0.0332031 0.274414 0.181641 0.0332031 0.274414 0.181641 0 1
|
||||
S
|
||||
-0.585889 0.570654 -0.318018 0.290186
|
||||
0.719727 0.0253906 0.277344 0.719727 0.0253906 0.277344 0 1
|
||||
S
|
||||
-0.568115 -0.184717 0.167578 0.11001
|
||||
0.242188 0.160156 0.526367 0.242188 0.160156 0.526367 0 1
|
||||
S
|
||||
-0.499561 -0.277393 0.196777 0.306543
|
||||
0.976562 0.648438 0.548828 0.976562 0.648438 0.548828 0 1
|
||||
S
|
||||
0.451953 0.507812 0.248193 0.118799
|
||||
0.55957 0.550781 0.433594 0.55957 0.550781 0.433594 0 1
|
||||
S
|
||||
-0.385303 0.112988 0.249463 0.223535
|
||||
0.948242 0.105469 0.254883 0.948242 0.105469 0.254883 0 1
|
||||
S
|
||||
0.21582 -0.0850586 -0.345947 0.235498
|
||||
0.416016 0.275391 0.583008 0.416016 0.275391 0.583008 0 1
|
||||
S
|
||||
0.222168 -0.283105 -0.0710937 0.206689
|
||||
0.862305 0.807617 0.253906 0.862305 0.807617 0.253906 0 1
|
||||
S
|
||||
-0.545898 0.353564 -0.521777 0.136133
|
||||
0.674805 0.420898 0.220703 0.674805 0.420898 0.220703 0 1
|
||||
S
|
||||
-0.152344 0.0177734 0.224707 0.306787
|
||||
0.798828 0.270508 0.321289 0.798828 0.270508 0.321289 0 1
|
||||
S
|
||||
0.164404 -0.24502 -0.374512 0.20376
|
||||
0.507812 0.109375 0.957031 0.507812 0.109375 0.957031 0 1
|
||||
S
|
||||
0.0495117 -0.250098 0.298975 0.245508
|
||||
0.820312 0.650391 0.00976562 0.820312 0.650391 0.00976562 0 1
|
||||
S
|
||||
-0.444336 -0.297705 0.478613 0.230859
|
||||
0.914062 0.0664062 0.667969 0.914062 0.0664062 0.667969 0 1
|
||||
S
|
||||
0.267236 0.333252 0.0723633 0.306055
|
||||
0.459961 0.543945 0.651367 0.459961 0.543945 0.651367 0 1
|
||||
S
|
||||
-0.168213 0.120605 0.0171387 0.101465
|
||||
0.191406 0.549805 0.420898 0.191406 0.549805 0.420898 0 1
|
||||
S
|
||||
0.194873 -0.428467 -0.246289 0.256006
|
||||
0.0439453 0.918945 0.207031 0.0439453 0.918945 0.207031 0 1
|
||||
S
|
||||
-0.562402 -0.370068 -0.140918 0.237207
|
||||
0.0273438 0.480469 0.0722656 0.0273438 0.480469 0.0722656 0 1
|
||||
S
|
||||
0.0380859 -0.355469 0.168848 0.232813
|
||||
0.0341797 0.629883 0.355469 0.0341797 0.629883 0.355469 0 1
|
||||
S
|
||||
-0.321826 -0.112988 0.645557 0.288477
|
||||
0.988281 0.980469 0.760742 0.988281 0.980469 0.760742 0 1
|
||||
S
|
||||
0.532568 -0.345313 0.531934 0.320215
|
||||
0.19043 0.560547 0.504883 0.19043 0.560547 0.504883 0 1
|
||||
S
|
||||
0.497021 -0.312305 -0.462744 0.125146
|
||||
0.0498047 0.928711 0.649414 0.0498047 0.928711 0.649414 0 1
|
||||
S
|
||||
0.599219 0.384033 0.180908 0.104883
|
||||
0.956055 0.461914 0.550781 0.956055 0.461914 0.550781 0 1
|
||||
S
|
||||
-0.644287 -0.059668 -0.589063 0.221582
|
||||
0.265625 0.914062 0.240234 0.265625 0.914062 0.240234 0 1
|
||||
S
|
||||
0.484326 0.0685547 -0.000634766 0.208887
|
||||
0.425781 0.183594 0.316406 0.425781 0.183594 0.316406 0 1
|
||||
38
CS4451/proj4/input/input19.txt
Normal file
38
CS4451/proj4/input/input19.txt
Normal file
@@ -0,0 +1,38 @@
|
||||
512 512
|
||||
0 0 20
|
||||
-1 -1 1
|
||||
2 0 0
|
||||
0 2 0
|
||||
1.5 0.5 1.1 0.8
|
||||
0.2
|
||||
10
|
||||
S
|
||||
-0.227881 0.0368164 0.58335 0.128076
|
||||
0.0791016 0.249023 0.0722656 0.0791016 0.249023 0.0722656 0 1
|
||||
S
|
||||
0.500195 -0.513525 -0.130127 0.14541
|
||||
0.916992 0.486328 0.745117 0.916992 0.486328 0.745117 0 1
|
||||
S
|
||||
0.343408 0.443066 0.571289 0.272363
|
||||
0.0820312 0.992188 0.776367 0.0820312 0.992188 0.776367 0 1
|
||||
S
|
||||
0.340234 -0.309131 0.072998 0.316309
|
||||
0.337891 0.294922 0.59668 0.337891 0.294922 0.59668 0 1
|
||||
S
|
||||
0.292627 -0.588428 -0.127588 0.325098
|
||||
0.849609 0.298828 0.0126953 0.849609 0.298828 0.0126953 0 1
|
||||
S
|
||||
-0.603662 0.293896 -0.0558594 0.139795
|
||||
0.337891 0.286133 0.34082 0.337891 0.286133 0.34082 0 1
|
||||
S
|
||||
0.484326 0.1479 0.594141 0.281885
|
||||
0.0917969 0.207031 0.416992 0.0917969 0.207031 0.416992 0 1
|
||||
S
|
||||
-0.112988 0.519873 0.524316 0.262842
|
||||
0.675781 0.0820312 0.516602 0.675781 0.0820312 0.516602 0 1
|
||||
S
|
||||
-0.00888672 -0.24502 0.576367 0.240869
|
||||
0.282227 0.30957 0.464844 0.282227 0.30957 0.464844 0 1
|
||||
S
|
||||
0.564307 0.253906 -0.3104 0.115137
|
||||
0.157227 0.563477 0.219727 0.157227 0.563477 0.219727 0 1
|
||||
191
CS4451/proj4/input/input2.txt
Normal file
191
CS4451/proj4/input/input2.txt
Normal file
@@ -0,0 +1,191 @@
|
||||
512 512
|
||||
0 0 -40
|
||||
-1 -1 -30
|
||||
2 0 0
|
||||
0 2 0
|
||||
100 100 -100 1
|
||||
1
|
||||
61
|
||||
S
|
||||
2 0 3 1.5
|
||||
.4 0 0 .2 0 0 .4 10
|
||||
S
|
||||
1.9894 0.205636 3 1.5
|
||||
.4 0 0 .2 0 0 .4 10
|
||||
S
|
||||
1.95771 0.409092 3 1.5
|
||||
.4 0 0 .2 0 0 .4 10
|
||||
S
|
||||
1.90528 0.608212 3 1.5
|
||||
.4 0 0 .2 0 0 .4 10
|
||||
S
|
||||
1.83264 0.800886 3 1.5
|
||||
.4 0 0 .2 0 0 .4 10
|
||||
S
|
||||
1.74059 0.98507 3 1.5
|
||||
.4 0 0 .2 0 0 .4 10
|
||||
S
|
||||
1.63008 1.15881 3 1.5
|
||||
.4 0 0 .2 0 0 .4 10
|
||||
S
|
||||
1.50229 1.32027 3 1.5
|
||||
.4 0 0 .2 0 0 .4 10
|
||||
S
|
||||
1.35858 1.46774 3 1.5
|
||||
.4 0 0 .2 0 0 .4 10
|
||||
S
|
||||
1.20047 1.59965 3 1.5
|
||||
.4 0 0 .2 0 0 .4 10
|
||||
S
|
||||
1.02964 1.7146 3 1.5
|
||||
.4 0 0 .2 0 0 .4 10
|
||||
S
|
||||
0.847889 1.81138 3 1.5
|
||||
.4 0 0 .2 0 0 .4 10
|
||||
S
|
||||
0.657154 1.88895 3 1.5
|
||||
.4 0 0 .2 0 0 .4 10
|
||||
S
|
||||
0.459452 1.94651 3 1.5
|
||||
.4 0 0 .2 0 0 .4 10
|
||||
S
|
||||
0.256881 1.98343 3 1.5
|
||||
.4 0 0 .2 0 0 .4 10
|
||||
S
|
||||
0.0515869 1.99933 3 1.5
|
||||
.4 0 0 .2 0 0 .4 10
|
||||
S
|
||||
-0.154254 1.99404 3 1.5
|
||||
.4 0 0 .2 0 0 .4 10
|
||||
S
|
||||
-0.35846 1.96761 3 1.5
|
||||
.4 0 0 .2 0 0 .4 10
|
||||
S
|
||||
-0.558866 1.92033 3 1.5
|
||||
.4 0 0 .2 0 0 .4 10
|
||||
S
|
||||
-0.753349 1.85269 3 1.5
|
||||
.4 0 0 .2 0 0 .4 10
|
||||
S
|
||||
-0.939846 1.76541 3 1.5
|
||||
.4 0 0 .2 0 0 .4 10
|
||||
S
|
||||
-1.11638 1.65943 3 1.5
|
||||
.4 0 0 .2 0 0 .4 10
|
||||
S
|
||||
-1.28108 1.53585 3 1.5
|
||||
.4 0 0 .2 0 0 .4 10
|
||||
S
|
||||
-1.43221 1.39599 3 1.5
|
||||
.4 0 0 .2 0 0 .4 10
|
||||
S
|
||||
-1.56815 1.24133 3 1.5
|
||||
.4 0 0 .2 0 0 .4 10
|
||||
S
|
||||
-1.68747 1.07352 3 1.5
|
||||
.4 0 0 .2 0 0 .4 10
|
||||
S
|
||||
-1.7889 0.894329 3 1.5
|
||||
.4 0 0 .2 0 0 .4 10
|
||||
S
|
||||
-1.87138 0.705658 3 1.5
|
||||
.4 0 0 .2 0 0 .4 10
|
||||
S
|
||||
-1.93401 0.509507 3 1.5
|
||||
.4 0 0 .2 0 0 .4 10
|
||||
S
|
||||
-1.97615 0.307955 3 1.5
|
||||
.4 0 0 .2 0 0 .4 10
|
||||
S
|
||||
-1.99734 0.10314 3 1.5
|
||||
.4 0 0 .2 0 0 .4 10
|
||||
S
|
||||
-1.99736 -0.102769 3 1.5
|
||||
.4 0 0 .2 0 0 .4 10
|
||||
S
|
||||
-1.97621 -0.307589 3 1.5
|
||||
.4 0 0 .2 0 0 .4 10
|
||||
S
|
||||
-1.93411 -0.509148 3 1.5
|
||||
.4 0 0 .2 0 0 .4 10
|
||||
S
|
||||
-1.87151 -0.705311 3 1.5
|
||||
.4 0 0 .2 0 0 .4 10
|
||||
S
|
||||
-1.78907 -0.893997 3 1.5
|
||||
.4 0 0 .2 0 0 .4 10
|
||||
S
|
||||
-1.68767 -1.07321 3 1.5
|
||||
.4 0 0 .2 0 0 .4 10
|
||||
S
|
||||
-1.56838 -1.24104 3 1.5
|
||||
.4 0 0 .2 0 0 .4 10
|
||||
S
|
||||
-1.43247 -1.39572 3 1.5
|
||||
.4 0 0 .2 0 0 .4 10
|
||||
S
|
||||
-1.28137 -1.53561 3 1.5
|
||||
.4 0 0 .2 0 0 .4 10
|
||||
S
|
||||
-1.11669 -1.65922 3 1.5
|
||||
.4 0 0 .2 0 0 .4 10
|
||||
S
|
||||
-0.940173 -1.76524 3 1.5
|
||||
.4 0 0 .2 0 0 .4 10
|
||||
S
|
||||
-0.753692 -1.85255 3 1.5
|
||||
.4 0 0 .2 0 0 .4 10
|
||||
S
|
||||
-0.559222 -1.92023 3 1.5
|
||||
.4 0 0 .2 0 0 .4 10
|
||||
S
|
||||
-0.358825 -1.96755 3 1.5
|
||||
.4 0 0 .2 0 0 .4 10
|
||||
S
|
||||
-0.154624 -1.99401 3 1.5
|
||||
.4 0 0 .2 0 0 .4 10
|
||||
S
|
||||
0.0512164 -1.99934 3 1.5
|
||||
.4 0 0 .2 0 0 .4 10
|
||||
S
|
||||
0.256514 -1.98348 3 1.5
|
||||
.4 0 0 .2 0 0 .4 10
|
||||
S
|
||||
0.459092 -1.9466 3 1.5
|
||||
.4 0 0 .2 0 0 .4 10
|
||||
S
|
||||
0.656804 -1.88908 3 1.5
|
||||
.4 0 0 .2 0 0 .4 10
|
||||
S
|
||||
0.847554 -1.81153 3 1.5
|
||||
.4 0 0 .2 0 0 .4 10
|
||||
S
|
||||
1.02932 -1.71479 3 1.5
|
||||
.4 0 0 .2 0 0 .4 10
|
||||
S
|
||||
1.20018 -1.59987 3 1.5
|
||||
.4 0 0 .2 0 0 .4 10
|
||||
S
|
||||
1.35831 -1.46799 3 1.5
|
||||
.4 0 0 .2 0 0 .4 10
|
||||
S
|
||||
1.50205 -1.32055 3 1.5
|
||||
.4 0 0 .2 0 0 .4 10
|
||||
S
|
||||
1.62986 -1.15911 3 1.5
|
||||
.4 0 0 .2 0 0 .4 10
|
||||
S
|
||||
1.7404 -0.985392 3 1.5
|
||||
.4 0 0 .2 0 0 .4 10
|
||||
S
|
||||
1.8325 -0.801225 3 1.5
|
||||
.4 0 0 .2 0 0 .4 10
|
||||
S
|
||||
1.90516 -0.608565 3 1.5
|
||||
.4 0 0 .2 0 0 .4 10
|
||||
S
|
||||
1.95764 -0.409455 3 1.5
|
||||
.4 0 0 .2 0 0 .4 10
|
||||
S
|
||||
1.98936 -0.206005 3 1.5
|
||||
.4 0 0 .2 0 0 .4 10
|
||||
191
CS4451/proj4/input/input3.txt
Normal file
191
CS4451/proj4/input/input3.txt
Normal file
@@ -0,0 +1,191 @@
|
||||
512 512
|
||||
0 0 -40
|
||||
-1 -1 -30
|
||||
2 0 0
|
||||
0 2 0
|
||||
100 100 -100 .72
|
||||
.72
|
||||
61
|
||||
S
|
||||
0 2 0 1.5
|
||||
0 0 0 0.1 0.1 0.1 .1 10
|
||||
S
|
||||
0.157573 1.9894 0.318931 1.5
|
||||
0.00273889 0.0109256 0.0244703 0.1 0.1 0.1 .3 50
|
||||
S
|
||||
0.313476 1.95771 0.63448 1.5
|
||||
0.0109256 0.0432248 0.0954861 0.1 0.1 0.1 .3 50
|
||||
S
|
||||
0.466056 1.90528 0.943305 1.5
|
||||
0.0244703 0.0954861 0.206096 0.1 0.1 0.1 .3 50
|
||||
S
|
||||
0.613696 1.83264 1.24213 1.5
|
||||
0.0432248 0.165426 0.345474 0.1 0.1 0.1 .3 50
|
||||
S
|
||||
0.754831 1.74059 1.52779 1.5
|
||||
0.0669834 0.249987 0.499977 0.1 0.1 0.1 .3 50
|
||||
S
|
||||
0.887965 1.63008 1.79726 1.5
|
||||
0.0954861 0.345474 0.654482 0.1 0.1 0.1 .3 50
|
||||
S
|
||||
1.01169 1.50229 2.04767 1.5
|
||||
0.12842 0.447714 0.793866 0.1 0.1 0.1 .3 50
|
||||
S
|
||||
1.12469 1.35858 2.27638 1.5
|
||||
0.165426 0.55224 0.904487 0.1 0.1 0.1 .3 50
|
||||
S
|
||||
1.22576 1.20047 2.48097 1.5
|
||||
0.206096 0.654482 0.975515 0.1 0.1 0.1 .3 50
|
||||
S
|
||||
1.31385 1.02964 2.65925 1.5
|
||||
0.249987 0.749973 1 0.1 0.1 0.1 .3 50
|
||||
S
|
||||
1.38801 0.847889 2.80935 1.5
|
||||
0.296616 0.83454 0.975544 0.1 0.1 0.1 .3 50
|
||||
S
|
||||
1.44745 0.657154 2.92967 1.5
|
||||
0.345474 0.904487 0.904541 0.1 0.1 0.1 .3 50
|
||||
S
|
||||
1.49156 0.459452 3.01894 1.5
|
||||
0.396025 0.956756 0.793941 0.1 0.1 0.1 .3 50
|
||||
S
|
||||
1.51985 0.256881 3.0762 1.5
|
||||
0.447714 0.989065 0.65457 0.1 0.1 0.1 .3 50
|
||||
S
|
||||
1.53203 0.0515869 3.10086 1.5
|
||||
0.499977 1 0.500069 0.1 0.1 0.1 .3 50
|
||||
S
|
||||
1.52798 -0.154254 3.09265 1.5
|
||||
0.55224 0.989084 0.345562 0.1 0.1 0.1 .3 50
|
||||
S
|
||||
1.50773 -0.35846 3.05167 1.5
|
||||
0.60393 0.956794 0.206171 0.1 0.1 0.1 .3 50
|
||||
S
|
||||
1.4715 -0.558866 2.97833 1.5
|
||||
0.654482 0.904541 0.0955405 0.1 0.1 0.1 .3 50
|
||||
S
|
||||
1.41967 -0.753349 2.87343 1.5
|
||||
0.703342 0.834609 0.0244989 0.1 0.1 0.1 .3 50
|
||||
S
|
||||
1.35279 -0.939846 2.73807 1.5
|
||||
0.749973 0.750053 8.58469e-09 0.1 0.1 0.1 .3 50
|
||||
S
|
||||
1.27157 -1.11638 2.57368 1.5
|
||||
0.793866 0.65457 0.0244417 0.1 0.1 0.1 .3 50
|
||||
S
|
||||
1.17688 -1.28108 2.38202 1.5
|
||||
0.83454 0.552332 0.0954316 0.1 0.1 0.1 .3 50
|
||||
S
|
||||
1.06971 -1.43221 2.1651 1.5
|
||||
0.871549 0.447806 0.206021 0.1 0.1 0.1 .3 50
|
||||
S
|
||||
0.951199 -1.56815 1.92524 1.5
|
||||
0.904487 0.345562 0.345386 0.1 0.1 0.1 .3 50
|
||||
S
|
||||
0.822609 -1.68747 1.66497 1.5
|
||||
0.932993 0.250067 0.499884 0.1 0.1 0.1 .3 50
|
||||
S
|
||||
0.685299 -1.7889 1.38706 1.5
|
||||
0.956756 0.165494 0.654394 0.1 0.1 0.1 .3 50
|
||||
S
|
||||
0.540726 -1.87138 1.09444 1.5
|
||||
0.975515 0.0955405 0.793791 0.1 0.1 0.1 .3 50
|
||||
S
|
||||
0.390421 -1.93401 0.790218 1.5
|
||||
0.989065 0.0432625 0.904432 0.1 0.1 0.1 .3 50
|
||||
S
|
||||
0.235977 -1.97615 0.477622 1.5
|
||||
0.997256 0.0109448 0.975487 0.1 0.1 0.1 .3 50
|
||||
S
|
||||
0.0790329 -1.99734 0.159964 1.5
|
||||
1 8.58469e-09 1 0.1 0.1 0.1 .3 50
|
||||
S
|
||||
-0.0787493 -1.99736 -0.15939 1.5
|
||||
0.997266 0.0109063 0.975573 0.1 0.1 0.1 .3 50
|
||||
S
|
||||
-0.235697 -1.97621 -0.477054 1.5
|
||||
0.989084 0.0431871 0.904596 0.1 0.1 0.1 .3 50
|
||||
S
|
||||
-0.390146 -1.93411 -0.789662 1.5
|
||||
0.975544 0.0954316 0.794016 0.1 0.1 0.1 .3 50
|
||||
S
|
||||
-0.54046 -1.87151 -1.0939 1.5
|
||||
0.956794 0.165357 0.654658 0.1 0.1 0.1 .3 50
|
||||
S
|
||||
-0.685045 -1.78907 -1.38654 1.5
|
||||
0.93304 0.249906 0.500162 0.1 0.1 0.1 .3 50
|
||||
S
|
||||
-0.822369 -1.68767 -1.66449 1.5
|
||||
0.904541 0.345386 0.34565 0.1 0.1 0.1 .3 50
|
||||
S
|
||||
-0.950976 -1.56838 -1.92479 1.5
|
||||
0.871611 0.447622 0.206246 0.1 0.1 0.1 .3 50
|
||||
S
|
||||
-1.0695 -1.43247 -2.16469 1.5
|
||||
0.834609 0.552148 0.095595 0.1 0.1 0.1 .3 50
|
||||
S
|
||||
-1.17669 -1.28137 -2.38165 1.5
|
||||
0.793941 0.654394 0.0245276 0.1 0.1 0.1 .3 50
|
||||
S
|
||||
-1.27141 -1.11669 -2.57336 1.5
|
||||
0.750053 0.749893 3.43388e-08 0.1 0.1 0.1 .3 50
|
||||
S
|
||||
-1.35265 -0.940173 -2.73779 1.5
|
||||
0.703426 0.834471 0.0244131 0.1 0.1 0.1 .3 50
|
||||
S
|
||||
-1.41956 -0.753692 -2.87321 1.5
|
||||
0.65457 0.904432 0.0953772 0.1 0.1 0.1 .3 50
|
||||
S
|
||||
-1.47142 -0.559222 -2.97817 1.5
|
||||
0.604021 0.956719 0.205946 0.1 0.1 0.1 .3 50
|
||||
S
|
||||
-1.50768 -0.358825 -3.05156 1.5
|
||||
0.552332 0.989046 0.345298 0.1 0.1 0.1 .3 50
|
||||
S
|
||||
-1.52796 -0.154624 -3.09261 1.5
|
||||
0.500069 1 0.499792 0.1 0.1 0.1 .3 50
|
||||
S
|
||||
-1.53204 0.0512164 -3.10088 1.5
|
||||
0.447806 0.989103 0.654306 0.1 0.1 0.1 .3 50
|
||||
S
|
||||
-1.51989 0.256514 -3.07628 1.5
|
||||
0.396115 0.956832 0.793716 0.1 0.1 0.1 .3 50
|
||||
S
|
||||
-1.49162 0.459092 -3.01907 1.5
|
||||
0.345562 0.904596 0.904378 0.1 0.1 0.1 .3 50
|
||||
S
|
||||
-1.44755 0.656804 -2.92986 1.5
|
||||
0.296701 0.834678 0.975458 0.1 0.1 0.1 .3 50
|
||||
S
|
||||
-1.38813 0.847554 -2.80959 1.5
|
||||
0.250067 0.750134 1 0.1 0.1 0.1 .3 50
|
||||
S
|
||||
-1.31399 1.02932 -2.65955 1.5
|
||||
0.206171 0.654658 0.975601 0.1 0.1 0.1 .3 50
|
||||
S
|
||||
-1.22593 1.20018 -2.48131 1.5
|
||||
0.165494 0.552424 0.90465 0.1 0.1 0.1 .3 50
|
||||
S
|
||||
-1.12488 1.35831 -2.27677 1.5
|
||||
0.128482 0.447899 0.794091 0.1 0.1 0.1 .3 50
|
||||
S
|
||||
-1.0119 1.50205 -2.0481 1.5
|
||||
0.0955405 0.34565 0.654746 0.1 0.1 0.1 .3 50
|
||||
S
|
||||
-0.888197 1.62986 -1.79773 1.5
|
||||
0.0670298 0.250147 0.500255 0.1 0.1 0.1 .3 50
|
||||
S
|
||||
-0.755078 1.7404 -1.52829 1.5
|
||||
0.0432625 0.165563 0.345738 0.1 0.1 0.1 .3 50
|
||||
S
|
||||
-0.613956 1.8325 -1.24266 1.5
|
||||
0.0244989 0.095595 0.206321 0.1 0.1 0.1 .3 50
|
||||
S
|
||||
-0.466327 1.90516 -0.943853 1.5
|
||||
0.0109448 0.0433002 0.0956495 0.1 0.1 0.1 .3 50
|
||||
S
|
||||
-0.313754 1.95764 -0.635043 1.5
|
||||
0.00274858 0.0109641 0.0245563 0.1 0.1 0.1 .3 50
|
||||
S
|
||||
-0.157856 1.98936 -0.319502 1.5
|
||||
8.58469e-09 3.43388e-08 7.72622e-08 0.1 0.1 0.1 .3 50
|
||||
16
CS4451/proj4/input/input4.txt
Normal file
16
CS4451/proj4/input/input4.txt
Normal file
@@ -0,0 +1,16 @@
|
||||
512 512
|
||||
0 0 -40
|
||||
-1 -1 -30
|
||||
2 0 0
|
||||
0 2 0
|
||||
100 100 -100 1
|
||||
1
|
||||
2
|
||||
T
|
||||
3 3 -1
|
||||
0 3 -1
|
||||
4 0 -1
|
||||
.5 .5 .5 .2 .2 .2 .3 20
|
||||
S
|
||||
0 0 5 4
|
||||
0 0 .5 0 0 .2 .3 20
|
||||
1208
CS4451/proj4/input/input5.txt
Normal file
1208
CS4451/proj4/input/input5.txt
Normal file
File diff suppressed because it is too large
Load Diff
14
CS4451/proj4/input/input6.txt
Normal file
14
CS4451/proj4/input/input6.txt
Normal file
@@ -0,0 +1,14 @@
|
||||
512 512
|
||||
0 0 -40
|
||||
-1 -1 -30
|
||||
2 0 0
|
||||
0 2 0
|
||||
100 100 -100 1
|
||||
1
|
||||
2
|
||||
S
|
||||
2.5 .5 -3 1
|
||||
.5 .5 .5 .2 .2 .2 .3 4
|
||||
S
|
||||
0 0 3 4
|
||||
0 0 .5 0 0 .2 .3 200
|
||||
132
CS4451/proj4/input/input7.txt
Normal file
132
CS4451/proj4/input/input7.txt
Normal file
@@ -0,0 +1,132 @@
|
||||
512 512
|
||||
0 0 -40
|
||||
-1 -1 -30
|
||||
2 0 0
|
||||
0 2 0
|
||||
-5 -5 -10 .36
|
||||
.36
|
||||
40
|
||||
T
|
||||
5 5 15
|
||||
-4.9 5 15
|
||||
5 -4.9 15
|
||||
.2 .2 .2 .2 .2 .2 .6 40
|
||||
T
|
||||
-5 -5 15
|
||||
-5 4.9 15
|
||||
4.9 -5 15
|
||||
.2 .2 .2 .2 .2 .2 .6 40
|
||||
S
|
||||
-1.75293 0.283203 9.4873 1.0877
|
||||
0.0791016 0.249023 0.0722656 0.379102 0.549023 0.372266 0.2 154.906
|
||||
S
|
||||
-3.9502 -1.00098 9.0918 -0.716992
|
||||
0.513672 0.745117 0.52832 0.813672 1.04512 0.82832 0.2 137.328
|
||||
S
|
||||
4.39453 1.55273 9.58984 -0.792188
|
||||
0.223633 0.523438 0.475586 0.523633 0.823438 0.775586 0.2 23.4609
|
||||
S
|
||||
-4.32617 -1.68945 8.52539 0.60332
|
||||
0.450195 0.905273 0.196289 0.750195 1.20527 0.496289 0.2 181.078
|
||||
S
|
||||
0.751953 -1.49414 9.93652 -0.728711
|
||||
0.452148 0.0859375 0.84082 0.752148 0.385937 1.14082 0.2 133.422
|
||||
S
|
||||
3.56934 3.2959 8.72559 0.427539
|
||||
0.914062 0.272461 0.0917969 1.21406 0.572461 0.391797 0.2 159.594
|
||||
S
|
||||
-2.08496 -0.869141 8.99902 1.00664
|
||||
0.651367 0.675781 0.0820312 0.951367 0.975781 0.382031 0.2 104.32
|
||||
S
|
||||
-0.0683594 -1.88477 9.43359 -0.363477
|
||||
0.282227 0.30957 0.464844 0.582227 0.60957 0.764844 0.2 174.633
|
||||
S
|
||||
1.95312 -2.3877 9.69727 0.0427734
|
||||
0.436523 0.780273 0.496094 0.736523 1.08027 0.796094 0.2 30.8828
|
||||
S
|
||||
2.19727 -3.75488 1.88477 0.552539
|
||||
0.521484 0.285156 0.145508 0.821484 0.585156 0.445508 0.2 180.297
|
||||
S
|
||||
-4.44824 -0.273438 9.55078 -0.341016
|
||||
0.269531 0.171875 0.0576172 0.569531 0.471875 0.357617 0.2 150.023
|
||||
S
|
||||
2.25586 -0.854492 3.45703 -0.632031
|
||||
0.519531 0.226562 0.963867 0.819531 0.526563 1.26387 0.2 18.9688
|
||||
S
|
||||
1.66016 -0.654297 2.33887 0.658008
|
||||
0.583984 0.724609 0.416992 0.883984 1.02461 0.716992 0.2 69.3594
|
||||
S
|
||||
-2.17773 -0.546875 7.86621 0.337695
|
||||
0.807617 0.746094 0.839844 1.10762 1.04609 1.13984 0.2 109.789
|
||||
S
|
||||
-4.01367 4.27734 6.62598 0.779102
|
||||
0.220703 0.234375 0.0273438 0.520703 0.534375 0.327344 0.2 70.1406
|
||||
S
|
||||
0.864258 -3.99414 3.64746 0.878711
|
||||
0.25293 0.376953 0.576172 0.55293 0.676953 0.876172 0.2 84.0078
|
||||
S
|
||||
2.46094 -0.546875 0.214844 0.276172
|
||||
0.384766 0.459961 0.582031 0.684766 0.759961 0.882031 0.2 36.9375
|
||||
S
|
||||
-3.25195 4.95117 1.58203 -0.258008
|
||||
0.736328 0.523438 0.914062 1.03633 0.823438 1.21406 0.2 187.719
|
||||
S
|
||||
-3.33984 2.05566 7.56348 0.311328
|
||||
0.824219 0.459961 0.543945 1.12422 0.759961 0.843945 0.2 70.7266
|
||||
S
|
||||
-1.29395 0.927734 5.13184 1.19414
|
||||
0.808594 0.450195 0.420898 1.10859 0.750195 0.720898 0.2 60.9609
|
||||
S
|
||||
-3.2959 -1.89453 1.87988 0.156055
|
||||
0.918945 0.207031 0.865234 1.21895 0.507031 1.16523 0.2 114.867
|
||||
S
|
||||
-1.08398 -2.74414 4.86328 -0.280469
|
||||
0.0722656 0.0585938 0.546875 0.372266 0.358594 0.846875 0.2 52.9531
|
||||
S
|
||||
-2.65625 4.8291 1.85059 -0.155469
|
||||
0.495117 0.173828 0.993164 0.795117 0.473828 1.29316 0.2 50.2188
|
||||
S
|
||||
-4.94141 0.0976562 6.19629 1.01934
|
||||
0.53125 0.818359 0.119141 0.83125 1.11836 0.419141 0.2 39.0859
|
||||
S
|
||||
-2.80273 2.47559 8.82324 -0.280469
|
||||
0.711914 0.899414 0.0498047 1.01191 1.19941 0.349805 0.2 15.2578
|
||||
S
|
||||
-3.24707 4.60938 7.9541 0.47832
|
||||
0.0195312 0.956055 0.461914 0.319531 1.25605 0.761914 0.2 90.8438
|
||||
S
|
||||
-4.95605 -0.458984 0.46875 -0.286328
|
||||
0.734375 0.914062 0.759766 1.03438 1.21406 1.05977 0.2 150.023
|
||||
S
|
||||
0.527344 -0.00488281 7.82227 0.774219
|
||||
0.183594 0.316406 0.617188 0.483594 0.616406 0.917188 0.2 52.1719
|
||||
S
|
||||
-4.10645 -4.2627 8.87695 -0.33418
|
||||
0.953125 0.275391 0.537109 1.25313 0.575391 0.837109 0.2 121.508
|
||||
S
|
||||
-1.76758 0.634766 8.37891 0.826953
|
||||
0.170898 0.786133 0.0751953 0.470898 1.08613 0.375195 0.2 36.9375
|
||||
S
|
||||
0.605469 0.844727 8.4668 0.0554688
|
||||
0.254883 0.452148 0.399414 0.554883 0.752148 0.699414 0.2 129.125
|
||||
S
|
||||
-2.74414 -4.1748 9.66797 0.467578
|
||||
0.151367 0.683594 0.477539 0.451367 0.983594 0.777539 0.2 6.27344
|
||||
S
|
||||
-2.68066 -3.51074 7.46094 -0.289258
|
||||
0.0224609 0.0292969 0.0917969 0.322461 0.329297 0.391797 0.2 134.789
|
||||
S
|
||||
-4.21875 -2.08008 6.47461 0.526172
|
||||
0.203125 0.629883 0.494141 0.503125 0.929883 0.794141 0.2 184.594
|
||||
S
|
||||
2.69531 -4.00879 3.86719 -0.00703125
|
||||
0.650391 0.373047 0.152344 0.950391 0.673047 0.452344 0.2 180.688
|
||||
S
|
||||
2.69043 0.429688 6.84082 -0.414258
|
||||
0.401367 0.890625 0.412109 0.701367 1.19063 0.712109 0.2 174.047
|
||||
S
|
||||
-4.05762 -0.478516 1.875 0.409961
|
||||
0.933594 0.283203 0.121094 1.23359 0.583203 0.421094 0.2 183.227
|
||||
S
|
||||
4.33105 -4.13086 7.0752 -0.136914
|
||||
0.456055 0.920898 0.418945 0.756055 1.2209 0.718945 0.2 184.594
|
||||
51
CS4451/proj4/input/input8.txt
Normal file
51
CS4451/proj4/input/input8.txt
Normal file
@@ -0,0 +1,51 @@
|
||||
512 512
|
||||
0 0 20
|
||||
-1 -1 1
|
||||
2 0 0
|
||||
0 2 0
|
||||
3 10 10 0.8
|
||||
0.2
|
||||
9
|
||||
T
|
||||
1 1 1
|
||||
0.12321 0.12321 -1
|
||||
-1 1 1
|
||||
1 1 1 1 1 1 0 1
|
||||
T
|
||||
-1 1 1
|
||||
-0.12321 0.12321 -1
|
||||
0.12321 0.12321 -1
|
||||
1 1 1 1 1 1 0 1
|
||||
T
|
||||
1 -1 1
|
||||
0.12321 -0.12321 -1
|
||||
-1 -1 1
|
||||
1 1 1 1 1 1 0 1
|
||||
T
|
||||
-1 -1 1
|
||||
-0.12321 -0.12321 -1
|
||||
0.12321 -0.12321 -1
|
||||
1 1 1 1 1 1 0 1
|
||||
T
|
||||
1 1 1
|
||||
0.12321 0.12321 -1
|
||||
1 -1 1
|
||||
1 0 0 1 0 0 0 1
|
||||
T
|
||||
1 -1 1
|
||||
0.12321 -0.12321 -1
|
||||
0.12321 0.12321 -1
|
||||
1 0 0 1 0 0 0 1
|
||||
T
|
||||
-1 1 1
|
||||
-0.12321 0.12321 -1
|
||||
-1 -1 1
|
||||
1 1 0 1 1 0 0 1
|
||||
T
|
||||
-1 -1 1
|
||||
-0.12321 -0.12321 -1
|
||||
-0.12321 0.12321 -1
|
||||
1 1 0 1 1 0 0 1
|
||||
S
|
||||
0 0 0 0.5
|
||||
1 0 1 1 0 1 0 1
|
||||
21
CS4451/proj4/input/input9.txt
Normal file
21
CS4451/proj4/input/input9.txt
Normal file
@@ -0,0 +1,21 @@
|
||||
512 512
|
||||
0 0 20
|
||||
-1 -1 1
|
||||
2 0 0
|
||||
0 2 0
|
||||
3 2 5 0.8
|
||||
0.2
|
||||
3
|
||||
T
|
||||
0 0.2 1
|
||||
1 1 0.5
|
||||
-1 1 0.5
|
||||
0 0 1 0 0 1 0 1
|
||||
T
|
||||
0 -0.2 1
|
||||
1 -1 0.5
|
||||
-1 -1 0.5
|
||||
0 0 1 0 0 1 0 1
|
||||
S
|
||||
0 0 0 0.7
|
||||
0 1 0 0 1 0 0 1
|
||||
22
CS4451/proj4/main.cpp
Normal file
22
CS4451/proj4/main.cpp
Normal file
@@ -0,0 +1,22 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <vector>
|
||||
|
||||
#include "structs.h"
|
||||
#include "FileReader.h"
|
||||
|
||||
#include <GL/glut.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
FileReader fr;
|
||||
|
||||
fr.parseFile(*Renderer::getInstance());
|
||||
|
||||
Renderer::getInstance()->init(&argc,argv);
|
||||
|
||||
glutMainLoop();
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
BIN
CS4451/proj4/p4help.pdf
Normal file
BIN
CS4451/proj4/p4help.pdf
Normal file
Binary file not shown.
BIN
CS4451/proj4/proj4.ncb
Normal file
BIN
CS4451/proj4/proj4.ncb
Normal file
Binary file not shown.
BIN
CS4451/proj4/proj4.pdf
Normal file
BIN
CS4451/proj4/proj4.pdf
Normal file
Binary file not shown.
21
CS4451/proj4/proj4.sln
Normal file
21
CS4451/proj4/proj4.sln
Normal file
@@ -0,0 +1,21 @@
|
||||
Microsoft Visual Studio Solution File, Format Version 8.00
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "proj4", "proj4.vcproj", "{577F92FC-3041-4141-8638-11BE9C639762}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfiguration) = preSolution
|
||||
Debug = Debug
|
||||
Release = Release
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfiguration) = postSolution
|
||||
{577F92FC-3041-4141-8638-11BE9C639762}.Debug.ActiveCfg = Debug|Win32
|
||||
{577F92FC-3041-4141-8638-11BE9C639762}.Debug.Build.0 = Debug|Win32
|
||||
{577F92FC-3041-4141-8638-11BE9C639762}.Release.ActiveCfg = Release|Win32
|
||||
{577F92FC-3041-4141-8638-11BE9C639762}.Release.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityAddIns) = postSolution
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
BIN
CS4451/proj4/proj4.suo
Normal file
BIN
CS4451/proj4/proj4.suo
Normal file
Binary file not shown.
BIN
CS4451/proj4/proj4.tar
Normal file
BIN
CS4451/proj4/proj4.tar
Normal file
Binary file not shown.
170
CS4451/proj4/proj4.vcproj
Normal file
170
CS4451/proj4/proj4.vcproj
Normal file
@@ -0,0 +1,170 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="7.10"
|
||||
Name="proj4"
|
||||
ProjectGUID="{577F92FC-3041-4141-8638-11BE9C639762}"
|
||||
Keyword="Win32Proj">
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"/>
|
||||
</Platforms>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="Debug"
|
||||
IntermediateDirectory="Debug"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
|
||||
MinimalRebuild="TRUE"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="5"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="TRUE"
|
||||
DebugInformationFormat="4"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="opengl32.lib glut32.lib glu32.lib"
|
||||
OutputFile="$(OutDir)/proj4.exe"
|
||||
LinkIncremental="2"
|
||||
GenerateDebugInformation="TRUE"
|
||||
ProgramDatabaseFile="$(OutDir)/proj4.pdb"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="Release"
|
||||
IntermediateDirectory="Release"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="3"
|
||||
GlobalOptimizations="TRUE"
|
||||
InlineFunctionExpansion="2"
|
||||
EnableIntrinsicFunctions="TRUE"
|
||||
FavorSizeOrSpeed="1"
|
||||
OmitFramePointers="TRUE"
|
||||
EnableFiberSafeOptimizations="TRUE"
|
||||
OptimizeForProcessor="2"
|
||||
OptimizeForWindowsApplication="TRUE"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="4"
|
||||
BufferSecurityCheck="FALSE"
|
||||
EnableEnhancedInstructionSet="1"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="TRUE"
|
||||
DebugInformationFormat="3"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="opengl32.lib glut32.lib glu32.lib"
|
||||
OutputFile="$(OutDir)/proj4.exe"
|
||||
LinkIncremental="1"
|
||||
GenerateDebugInformation="TRUE"
|
||||
SubSystem="1"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
|
||||
<File
|
||||
RelativePath=".\FileReader.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Input.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\main.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Renderer.cpp">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
|
||||
<File
|
||||
RelativePath=".\defs.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\FileReader.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Input.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Renderer.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\structs.h">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Resource Files"
|
||||
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
|
||||
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
||||
132
CS4451/proj4/structs.h
Normal file
132
CS4451/proj4/structs.h
Normal file
@@ -0,0 +1,132 @@
|
||||
#ifndef _STRUCTS_H_
|
||||
#define _STRUCTS_H_
|
||||
|
||||
#include "defs.h"
|
||||
#include <iostream>
|
||||
|
||||
#include <GL/glut.h>
|
||||
#include <math.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
typedef struct MaterialAttributes {
|
||||
m_float k_dr, k_dg, k_db; //diffuse properties, rgb
|
||||
m_float k_ar, k_ag, k_ab; //ambient properties, rgb
|
||||
m_float k_s; //specular properties, rgb same
|
||||
m_float n_spec; //specular exponent
|
||||
|
||||
MaterialAttributes() {
|
||||
k_dr = k_dg = k_db = k_ar = k_ag = k_ab = k_s = n_spec = 0;
|
||||
}
|
||||
|
||||
void printMe() {
|
||||
cout << " MaterialAttributes:\n";
|
||||
cout << " k_dr: " << k_dr << " k_dg: " << k_dg << " k_db: " << k_db << endl;
|
||||
cout << " k_ar: " << k_ar << " k_ag: " << k_ag << " k_ab: " << k_ab << endl;
|
||||
cout << " k_s: " << k_s << " n_spec: " << n_spec << endl;
|
||||
}
|
||||
} MaterialAttributes;
|
||||
|
||||
typedef struct Point {
|
||||
m_float x,y,z;
|
||||
void printMe() {
|
||||
cout << " x: " << x << " y: " << y << " z: " << z << endl;
|
||||
}
|
||||
Point() {
|
||||
x = y = z =0;
|
||||
}
|
||||
inline static void add(Point& dest, Point src1, Point src2) {
|
||||
dest.x = src1.x + src2.x;
|
||||
dest.y = src1.y + src2.y;
|
||||
dest.z = src1.z + src2.z;
|
||||
}
|
||||
|
||||
inline static void sub(Point& dest, Point src1, Point src2) {
|
||||
dest.x = src1.x - src2.x;
|
||||
dest.y = src1.y - src2.y;
|
||||
dest.z = src1.z - src2.z;
|
||||
}
|
||||
|
||||
inline static void div(Point& dest, Point src1, Point src2) {
|
||||
dest.x = src1.x / src2.x;
|
||||
dest.y = src1.y / src2.y;
|
||||
dest.z = src1.z / src2.z;
|
||||
}
|
||||
|
||||
inline static void mul(Point& dest, Point src1, Point src2) {
|
||||
dest.x = src1.x * src2.x;
|
||||
dest.y = src1.y * src2.y;
|
||||
dest.z = src1.z * src2.z;
|
||||
}
|
||||
|
||||
inline static void mul(Point& dest, Point src, m_float src2) {
|
||||
dest.x = src.x*src2;
|
||||
dest.y = src.y*src2;
|
||||
dest.z = src.z*src2;
|
||||
}
|
||||
|
||||
inline static void exp(Point& dest, Point src, m_float exp) {
|
||||
dest.x = pow(src.x, exp);
|
||||
dest.y = pow(src.y, exp);
|
||||
dest.z = pow(src.z, exp);
|
||||
}
|
||||
|
||||
inline m_float magnitude() {
|
||||
return sqrt(pow(this->x,2) + pow(this->y,2) + pow(this->z,2));
|
||||
}
|
||||
|
||||
inline static Point normalize(Point src) {
|
||||
Point p = src;
|
||||
p.x /= src.magnitude();
|
||||
p.y /= src.magnitude();
|
||||
p.z /= src.magnitude();
|
||||
return p;
|
||||
}
|
||||
|
||||
inline static void dot(Point& dest, Point src1, Point src2) {
|
||||
dest.x = src1.x * src2.x;
|
||||
dest.y = src1.y * src2.y;
|
||||
dest.z = src1.z * src2.z;
|
||||
}
|
||||
|
||||
inline static void cross(Point &dest, Point &a, Point &b) {
|
||||
dest.x = ( (a.y*b.z) - (a.z*b.y) ); //i
|
||||
dest.y = ( (a.z*b.x) - (a.x*b.z) ); //j
|
||||
dest.z = ( (a.x*b.y) - (a.y*b.x) ); //k
|
||||
}
|
||||
|
||||
} Point;
|
||||
|
||||
typedef struct Sphere {
|
||||
MaterialAttributes m_attr;
|
||||
Point center;
|
||||
GLUquadricObj* glSphere;
|
||||
m_float radius;
|
||||
|
||||
Sphere() {
|
||||
glSphere = NULL;
|
||||
}
|
||||
|
||||
void printMe() {
|
||||
cout << "Sphere: " << endl;
|
||||
cout << " Center ";
|
||||
center.printMe();
|
||||
cout << " Radius: " << radius << endl;
|
||||
m_attr.printMe();
|
||||
|
||||
}
|
||||
} Sphere;
|
||||
|
||||
typedef struct Triangle {
|
||||
MaterialAttributes m_attr;
|
||||
Point a1, a2, a3;
|
||||
} Triangle;
|
||||
|
||||
typedef struct Light {
|
||||
Point center;
|
||||
m_float intensity;
|
||||
} Light;
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user