From cde789fb6cfd64f3e1cc719ad2602c843258aa07 Mon Sep 17 00:00:00 2001 From: Pavel Date: Sun, 12 Jan 2020 22:38:00 +0300 Subject: [PATCH] Computer graphics lab with tajmahal https://github.com/math10/Computer-Graphics-lab --- Computer-Graphics-lab-master/.gitattributes | 17 + Computer-Graphics-lab-master/.gitignore | 43 ++ .../Tajmahal_cg/Tajmahal_cg.cbp | 51 ++ .../Tajmahal_cg/Tajmahal_cg.depend | 250 ++++++++ .../Tajmahal_cg/Tajmahal_cg.layout | 7 + .../Tajmahal_cg/color.h | 111 ++++ .../Tajmahal_cg/imageloader.h | 221 +++++++ .../Tajmahal_cg/main.cpp | 602 ++++++++++++++++++ .../Tajmahal_cg/obj/Debug/main.o | Bin 0 -> 76592 bytes .../Tajmahal_cg/vec3f.h | 163 +++++ 10 files changed, 1465 insertions(+) create mode 100644 Computer-Graphics-lab-master/.gitattributes create mode 100644 Computer-Graphics-lab-master/.gitignore create mode 100644 Computer-Graphics-lab-master/Tajmahal_cg/Tajmahal_cg.cbp create mode 100644 Computer-Graphics-lab-master/Tajmahal_cg/Tajmahal_cg.depend create mode 100644 Computer-Graphics-lab-master/Tajmahal_cg/Tajmahal_cg.layout create mode 100644 Computer-Graphics-lab-master/Tajmahal_cg/color.h create mode 100644 Computer-Graphics-lab-master/Tajmahal_cg/imageloader.h create mode 100644 Computer-Graphics-lab-master/Tajmahal_cg/main.cpp create mode 100644 Computer-Graphics-lab-master/Tajmahal_cg/obj/Debug/main.o create mode 100644 Computer-Graphics-lab-master/Tajmahal_cg/vec3f.h diff --git a/Computer-Graphics-lab-master/.gitattributes b/Computer-Graphics-lab-master/.gitattributes new file mode 100644 index 0000000..bdb0cab --- /dev/null +++ b/Computer-Graphics-lab-master/.gitattributes @@ -0,0 +1,17 @@ +# Auto detect text files and perform LF normalization +* text=auto + +# Custom for Visual Studio +*.cs diff=csharp + +# Standard to msysgit +*.doc diff=astextplain +*.DOC diff=astextplain +*.docx diff=astextplain +*.DOCX diff=astextplain +*.dot diff=astextplain +*.DOT diff=astextplain +*.pdf diff=astextplain +*.PDF diff=astextplain +*.rtf diff=astextplain +*.RTF diff=astextplain diff --git a/Computer-Graphics-lab-master/.gitignore b/Computer-Graphics-lab-master/.gitignore new file mode 100644 index 0000000..96374c4 --- /dev/null +++ b/Computer-Graphics-lab-master/.gitignore @@ -0,0 +1,43 @@ +# Windows image file caches +Thumbs.db +ehthumbs.db + +# Folder config file +Desktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msm +*.msp + +# Windows shortcuts +*.lnk + +# ========================= +# Operating System Files +# ========================= + +# OSX +# ========================= + +.DS_Store +.AppleDouble +.LSOverride + +# Thumbnails +._* + +# Files that might appear on external disk +.Spotlight-V100 +.Trashes + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk diff --git a/Computer-Graphics-lab-master/Tajmahal_cg/Tajmahal_cg.cbp b/Computer-Graphics-lab-master/Tajmahal_cg/Tajmahal_cg.cbp new file mode 100644 index 0000000..1661cd4 --- /dev/null +++ b/Computer-Graphics-lab-master/Tajmahal_cg/Tajmahal_cg.cbp @@ -0,0 +1,51 @@ + + + + + + diff --git a/Computer-Graphics-lab-master/Tajmahal_cg/Tajmahal_cg.depend b/Computer-Graphics-lab-master/Tajmahal_cg/Tajmahal_cg.depend new file mode 100644 index 0000000..4dbddff --- /dev/null +++ b/Computer-Graphics-lab-master/Tajmahal_cg/Tajmahal_cg.depend @@ -0,0 +1,250 @@ +# depslib dependency file v1.0 +1441643058 source:c:\users\sanim\desktop\thesis\tajmahal_cg\main.cpp + + + "imageloader.h" + "color.h" + +1434386397 c:\program files\codeblocks-ep\mingw\include\gl\glut.h + + + + + +1258799516 c:\program files\codeblocks-ep\mingw\include\windows.h + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +1258799516 c:\program files\codeblocks-ep\mingw\include\winresrc.h + + + + + + + +1258799516 c:\program files\codeblocks-ep\mingw\include\winuser.h + +1258799516 c:\program files\codeblocks-ep\mingw\include\winnt.h + + + + + + +1258799516 c:\program files\codeblocks-ep\mingw\include\winerror.h + +1259406758 c:\program files\codeblocks-ep\mingw\include\string.h + <_mingw.h> + + +1259406752 c:\program files\codeblocks-ep\mingw\include\_mingw.h + +1258799502 c:\program files\codeblocks-ep\mingw\include\basetsd.h + +1258799510 c:\program files\codeblocks-ep\mingw\include\pshpack4.h + +1258799510 c:\program files\codeblocks-ep\mingw\include\poppack.h + +1258799516 c:\program files\codeblocks-ep\mingw\include\winver.h + +1258799502 c:\program files\codeblocks-ep\mingw\include\dde.h + +1258799504 c:\program files\codeblocks-ep\mingw\include\dlgs.h + +1258799502 c:\program files\codeblocks-ep\mingw\include\commctrl.h + + +1258799510 c:\program files\codeblocks-ep\mingw\include\prsht.h + +1258799516 c:\program files\codeblocks-ep\mingw\include\windef.h + + +1258799516 c:\program files\codeblocks-ep\mingw\include\wincon.h + +1258799516 c:\program files\codeblocks-ep\mingw\include\winbase.h + +1258799516 c:\program files\codeblocks-ep\mingw\include\wingdi.h + +1258799516 c:\program files\codeblocks-ep\mingw\include\winnls.h + +1258799516 c:\program files\codeblocks-ep\mingw\include\winnetwk.h + +1258799516 c:\program files\codeblocks-ep\mingw\include\winreg.h + +1258799516 c:\program files\codeblocks-ep\mingw\include\winsvc.h + +1258799502 c:\program files\codeblocks-ep\mingw\include\cderr.h + +1258799502 c:\program files\codeblocks-ep\mingw\include\ddeml.h + +1258799504 c:\program files\codeblocks-ep\mingw\include\imm.h + +1258799508 c:\program files\codeblocks-ep\mingw\include\lzexpand.h + +1258799508 c:\program files\codeblocks-ep\mingw\include\mmsystem.h + +1258799508 c:\program files\codeblocks-ep\mingw\include\nb30.h + +1258799512 c:\program files\codeblocks-ep\mingw\include\rpc.h + + + + + + + +1258799512 c:\program files\codeblocks-ep\mingw\include\rpcdce.h + + + +1258799502 c:\program files\codeblocks-ep\mingw\include\basetyps.h + +1258799512 c:\program files\codeblocks-ep\mingw\include\rpcdcep.h + +1258799512 c:\program files\codeblocks-ep\mingw\include\rpcnsi.h + +1258799512 c:\program files\codeblocks-ep\mingw\include\rpcnterr.h + +1259406754 c:\program files\codeblocks-ep\mingw\include\excpt.h + <_mingw.h> + + +1258799514 c:\program files\codeblocks-ep\mingw\include\shellapi.h + + + +1258799510 c:\program files\codeblocks-ep\mingw\include\pshpack2.h + +1258799516 c:\program files\codeblocks-ep\mingw\include\winperf.h + +1258799502 c:\program files\codeblocks-ep\mingw\include\commdlg.h + + + +1258799514 c:\program files\codeblocks-ep\mingw\include\unknwn.h + + + + +1258799510 c:\program files\codeblocks-ep\mingw\include\objfwd.h + + +1258799518 c:\program files\codeblocks-ep\mingw\include\wtypes.h + + + +1258799512 c:\program files\codeblocks-ep\mingw\include\rpcndr.h + + + +1258799512 c:\program files\codeblocks-ep\mingw\include\rpcnsip.h + +1258799516 c:\program files\codeblocks-ep\mingw\include\winspool.h + +1258799516 c:\program files\codeblocks-ep\mingw\include\winsock2.h + + +1258799516 c:\program files\codeblocks-ep\mingw\include\winsock.h + + + +1258799508 c:\program files\codeblocks-ep\mingw\include\mswsock.h + +1258799510 c:\program files\codeblocks-ep\mingw\include\ole2.h + + + + + + +1258799510 c:\program files\codeblocks-ep\mingw\include\objbase.h + + + + + + + + + +1259406758 c:\program files\codeblocks-ep\mingw\include\stdlib.h + <_mingw.h> + + +1258799510 c:\program files\codeblocks-ep\mingw\include\objidl.h + + +1258799502 c:\program files\codeblocks-ep\mingw\include\cguid.h + +1258799510 c:\program files\codeblocks-ep\mingw\include\olectlid.h + +1258799510 c:\program files\codeblocks-ep\mingw\include\oleauto.h + + +1258799510 c:\program files\codeblocks-ep\mingw\include\oaidl.h + + + +1258799510 c:\program files\codeblocks-ep\mingw\include\oleidl.h + + +1258799518 c:\program files\codeblocks-ep\mingw\include\gl\gl.h + +1258799518 c:\program files\codeblocks-ep\mingw\include\gl\glu.h + + + +1259406756 c:\program files\codeblocks-ep\mingw\include\stdio.h + <_mingw.h> + + + + +1259406760 c:\program files\codeblocks-ep\mingw\include\sys\types.h + <_mingw.h> + + +1259406756 c:\program files\codeblocks-ep\mingw\include\math.h + <_mingw.h> + +1441554913 c:\users\sanim\desktop\thesis\tajmahal_cg\imageloader.h + + + +1259406752 c:\program files\codeblocks-ep\mingw\include\assert.h + <_mingw.h> + +1439186349 c:\users\sanim\desktop\thesis\tajmahal_cg\vec3f.h + + + "vec3f.h" + +1374680643 c:\users\sanim\desktop\thesis\tajmahal_cg\color.h + diff --git a/Computer-Graphics-lab-master/Tajmahal_cg/Tajmahal_cg.layout b/Computer-Graphics-lab-master/Tajmahal_cg/Tajmahal_cg.layout new file mode 100644 index 0000000..d3dd98f --- /dev/null +++ b/Computer-Graphics-lab-master/Tajmahal_cg/Tajmahal_cg.layout @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Computer-Graphics-lab-master/Tajmahal_cg/color.h b/Computer-Graphics-lab-master/Tajmahal_cg/color.h new file mode 100644 index 0000000..7d75929 --- /dev/null +++ b/Computer-Graphics-lab-master/Tajmahal_cg/color.h @@ -0,0 +1,111 @@ +#define Red 1.0,0.0,0.0 +#define Green 0.0,1.0,0.0 +#define Blue 0.0,0.0,1.0 +#define Yellow 1.0,1.0,0.0 +#define Cyan 0.0,1.0,1.0 +#define Magenta 1.0,0.0,1.0 +#define White 1.0,1.0,1.0 +#define Black 0.0,0.0,0.0 + +#define GoldPole 0.627451,0.627451,0 + +#define DimGray 0.329412,0.329412,0.329412 +#define Gray 0.752941,0.752941,0.752941 +#define LightGray 0.658824,0.658824,0.658824 +#define VLightGray 0.80,0.80,0.80 + +#define Aquamarine 0.439216,0.858824,0.576471 +#define BlueViolet 0.62352,0.372549,0.623529 +#define Brown 0.647059,0.164706,0.164706 +#define CadetBlue 0.372549,0.623529,0.623529 +#define Coral 1.0,0.498039,0.0 +#define CornflowerBlue 0.258824,0.258824,0.435294 +#define DarkGreen 0.184314,0.309804,0.184314 +#define DarkOliveGreen 0.309804,0.309804,0.184314 +#define DarkOrchid 0.6,0.196078,0.8 +#define DarkSlateBlue 0.419608,0.137255,0.556863 +#define DarkSlateGray 0.184314,0.309804,0.309804 +#define DarkSlateGrey 0.184314,0.309804,0.309804 +#define DarkTurquoise 0.439216,0.576471,0.858824 +#define Firebrick 0.556863,0.137255,0.137255 +#define ForestGreen 0.137255,0.556863,0.137255 +#define Gold 0.8,0.498039,0.196078 +#define Goldenrod 0.858824,0.858824,0.439216 +#define GreenYellow 0.576471,0.858824,0.439216 +#define IndianRed 0.309804,0.184314,0.184314 +#define Khaki 0.623529,0.623529,0.372549 +#define LightBlue 0.74902,0.847059,0.847059 +#define LightSteelBlue 0.560784,0.560784,0.737255 +#define LimeGreen 0.196078,0.8,0.196078 +#define Maroon 0.556863,0.137255,0.419608 +#define MediumAquamarine 0.196078,0.8,0.6 +#define MediumBlue 0.196078,0.196078,0.8 +#define MediumForestGreen 0.419608,0.556863,0.137255 +#define MediumGoldenrod 0.917647,0.917647,0.678431 +#define MediumOrchid 0.576471,0.439216,0.858824 +#define MediumSeaGreen 0.258824,0.435294,0.258824 +#define MediumSlateBlue 0.498039,1.0 +#define MediumSpringGreen 0.498039,1.0 +#define MediumTurquoise 0.439216,0.858824,0.858824 +#define MediumVioletRed 0.858824,0.439216,0.576471 +#define MidnightBlue 0.184314,0.184314,0.309804 +#define Navy 0.137255,0.137255,0.556863 +#define NavyBlue 0.137255,0.137255,0.556863 +#define Orange 1,0.5,0.0 +#define OrangeRed 1.0,0.25 +#define Orchid 0.858824,0.439216,0.858824 +#define PaleGreen 0.560784,0.737255,0.560784 +#define Pink 0.737255,0.560784,0.560784 +#define Plum 0.917647,0.678431,0.917647 +#define Salmon 0.435294,0.258824,0.258824 +#define SeaGreen 0.137255,0.556863,0.419608 +#define Sienna 0.556863,0.419608,0.137255 +#define SkyBlue 0.196078,0.6,0.8 +#define SlateBlue = color,0.498039,1.0 +#define SpringGreen = color,1.0,0.498039 +#define SteelBlue 0.137255,0.419608,0.556863 +#define Tan 0.858824,0.576471,0.439216 +#define Thistle 0.847059,0.74902,0.847059 +#define Turquoise 0.678431,0.917647,0.917647 +#define Violet 0.309804,0.184314,0.309804 +#define VioletRed 0.8,0.196078,0.6 +#define Wheat 0.847059,0.847059,0.74902 +#define YellowGreen 0.6,0.8,0.196078 +#define SummerSky 0.22,0.69,0.87 +#define RichBlue 0.35,0.35,0.67 +#define Brass 0.71,0.65,0.26 +#define Copper 0.72,0.45,0.20 +#define Bronze 0.55,0.47,0.14 +#define Bronze2 0.65,0.49,0.24 +#define Silver 0.90,0.91,0.98 +#define BrightGold 0.85,0.85,0.10 +#define OldGold 0.81,0.71,0.23 +#define Feldspar 0.82,0.57,0.46 +#define Quartz 0.85,0.85,0.95 +// #define Mica = color Black // needed in textures.inc +#define NeonPink 1.00,0.43,0.78 +#define DarkPurple 0.53,0.12,0.47 +#define NeonBlue 0.30,0.30,1.00 +#define CoolCopper 0.85,0.53,0.10 +#define MandarinOrange 0.89,0.47,0.20 +#define LightWood 0.91,0.76,0.65 +#define MediumWood 0.65,0.50,0.39 +#define DarkWood 0.52,0.37,0.26 +#define SpicyPink 1.00,0.11,0.68 +#define SemiSweetChoc 0.42,0.26,0.15 +#define BakersChoc 0.36,0.20,0.09 +#define Flesh 0.96,0.80,0.69 +#define NewTan 0.92,0.78,0.62 +#define NewMidnightBlue 0.00,0.00,0.61 +#define VeryDarkBrown 0.35,0.16,0.14 +#define DarkBrown 0.36,0.25,0.20 +#define DarkTan 0.59,0.41,0.31 +#define GreenCopper 0.32,0.49,0.46 +#define DkGreenCopper 0.29,0.46,0.43 +#define DustyRose 0.52,0.39,0.39 +#define HuntersGreen 0.13,0.37,0.31 +#define Scarlet 0.55,0.09,0.09 + +#define MedPurple 0.73,0.16,0.96 +#define LightPurple 0.87,0.58,0.98 +#define VeryLightPurple 0.94,0.81,0.99 diff --git a/Computer-Graphics-lab-master/Tajmahal_cg/imageloader.h b/Computer-Graphics-lab-master/Tajmahal_cg/imageloader.h new file mode 100644 index 0000000..53e77f1 --- /dev/null +++ b/Computer-Graphics-lab-master/Tajmahal_cg/imageloader.h @@ -0,0 +1,221 @@ +/* Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above notice and this permission notice shall be included in all copies + * or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +/* File for "Terrain" lesson of the OpenGL tutorial on + * www.videotutorialsrock.com + */ + + + +#ifndef IMAGE_LOADER_H_INCLUDED +#define IMAGE_LOADER_H_INCLUDED +#include +#include + +using namespace std; +//Represents an image +class Image { + public: + Image(char* ps, int w, int h); + ~Image(); + + /* An array of the form (R1, G1, B1, R2, G2, B2, ...) indicating the + * color of each pixel in image. Color components range from 0 to 255. + * The array starts the bottom-left pixel, then moves right to the end + * of the row, then moves up to the next column, and so on. This is the + * format in which OpenGL likes images. + */ + char* pixels; + int width; + int height; +}; + + + +Image::Image(char* ps, int w, int h) : pixels(ps), width(w), height(h) { + +} + +Image::~Image() { + delete[] pixels; +} + +namespace { + //Converts a four-character array to an integer, using little-endian form + int toInt(const char* bytes) { + return (int)(((unsigned char)bytes[3] << 24) | + ((unsigned char)bytes[2] << 16) | + ((unsigned char)bytes[1] << 8) | + (unsigned char)bytes[0]); + } + + //Converts a two-character array to a short, using little-endian form + short toShort(const char* bytes) { + return (short)(((unsigned char)bytes[1] << 8) | + (unsigned char)bytes[0]); + } + + //Reads the next four bytes as an integer, using little-endian form + int readInt(ifstream &input) { + char buffer[4]; + input.read(buffer, 4); + return toInt(buffer); + } + + //Reads the next two bytes as a short, using little-endian form + short readShort(ifstream &input) { + char buffer[2]; + input.read(buffer, 2); + return toShort(buffer); + } + + //Just like auto_ptr, but for arrays + template + class auto_array { + private: + T* array; + mutable bool isReleased; + public: + explicit auto_array(T* array_ = NULL) : + array(array_), isReleased(false) { + } + + auto_array(const auto_array &aarray) { + array = aarray.array; + isReleased = aarray.isReleased; + aarray.isReleased = true; + } + + ~auto_array() { + if (!isReleased && array != NULL) { + delete[] array; + } + } + + T* get() const { + return array; + } + + T &operator*() const { + return *array; + } + + void operator=(const auto_array &aarray) { + if (!isReleased && array != NULL) { + delete[] array; + } + array = aarray.array; + isReleased = aarray.isReleased; + aarray.isReleased = true; + } + + T* operator->() const { + return array; + } + + T* release() { + isReleased = true; + return array; + } + + void reset(T* array_ = NULL) { + if (!isReleased && array != NULL) { + delete[] array; + } + array = array_; + } + + T* operator+(int i) { + return array + i; + } + + T &operator[](int i) { + return array[i]; + } + }; +} + +Image* loadBMP(const char* filename) { + ifstream input; + input.open(filename, ifstream::binary); + assert(!input.fail() || !"Could not find file"); + char buffer[2]; + input.read(buffer, 2); + assert(buffer[0] == 'B' && buffer[1] == 'M' || !"Not a bitmap file"); + input.ignore(8); + int dataOffset = readInt(input); + + //Read the header + int headerSize = readInt(input); + int width; + int height; + switch(headerSize) { + case 40: + //V3 + width = readInt(input); + height = readInt(input); + input.ignore(2); + assert(readShort(input) == 24 || !"Image is not 24 bits per pixel"); + assert(readShort(input) == 0 || !"Image is compressed"); + break; + case 12: + //OS/2 V1 + width = readShort(input); + height = readShort(input); + input.ignore(2); + assert(readShort(input) == 24 || !"Image is not 24 bits per pixel"); + break; + case 64: + //OS/2 V2 + assert(!"Can't load OS/2 V2 bitmaps"); + break; + case 108: + //Windows V4 + assert(!"Can't load Windows V4 bitmaps"); + break; + case 124: + //Windows V5 + assert(!"Can't load Windows V5 bitmaps"); + break; + default: + assert(!"Unknown bitmap format"); + } + + //Read the data + int bytesPerRow = ((width * 3 + 3) / 4) * 4 - (width * 3 % 4); + int size = bytesPerRow * height; + auto_array pixels(new char[size]); + input.seekg(dataOffset, ios_base::beg); + input.read(pixels.get(), size); + //cout << height << " " << width << endl; + + //Get the data into the right format + auto_array pixels2(new char[width * height * 3]); + for(int y = 0; y < height; y++) { + for(int x = 0; x < width; x++) { + for(int c = 0; c < 3; c++) { + pixels2[3 * (width * y + x) + c] = + pixels[bytesPerRow * y + 3 * x + (2 - c)]; + } + } + } + + input.close(); + return new Image(pixels2.release(), width, height); +} +#endif diff --git a/Computer-Graphics-lab-master/Tajmahal_cg/main.cpp b/Computer-Graphics-lab-master/Tajmahal_cg/main.cpp new file mode 100644 index 0000000..fc3797b --- /dev/null +++ b/Computer-Graphics-lab-master/Tajmahal_cg/main.cpp @@ -0,0 +1,602 @@ + +/* +Author :: MD. Musfiqur Rahman Sanim +Aust cse 28th Batch +ID:11.02.04.097 +*/ + + +//{ Template +using namespace std; +//{ headers +#include +//} +//{ Loops +#define forab(i,a,b) for (__typeof(b) i = (a); i <= (b); ++i) +#define rep(i,n) forab (i, 0, (n) - 1) +#define For(i,n) forab (i, 1, n) +#define rofba(i,a,b) for (__typeof(b) i = (b); i >= (a); --i) +#define per(i,n) rofba (i, 0, (n) - 1) +#define rof(i,n) rofba (i, 1, n) +#define forstl(i,s) for (__typeof ((s).end ()) i = (s).begin (); i != (s).end (); ++i) +//} +//{ Floating-points +#define EPS 1e-7 +#define abs(x) (((x) < 0) ? - (x) : (x)) +#define zero(x) (abs (x) < EPS) +#define equal(a,b) (zero ((a) - (b))) +#define PI 2*acos (0.0) +//} +typedef long long int64; +typedef unsigned long long int64u; +#define memo(a,v) memset(a,v,sizeof(a)) +#define all(a) a.begin(),a.end() +#define db double +#define pb push_back +#define eb emplace_back +#define pii pair +#define NL puts("") +#define ff first +#define ss second +//{ +//Intput_Output +#define gc getchar +#define II ({ int a; read(a); a;}) +#define IL ({ int64 a; read(a); a;}) +#define ID ({ db a; scanf("%lf",&a); a;}) +#define IC ({ char a; scanf("%c",&a); a;}) +#define IS ({ string a; cin >> a; a;}) +#define OC printf("Case %d:",cs); +//} +//} +#define _stl(x) {__stl_print__(x);} +#define __(args...) {dbg,args; cerr<inline bool read(T &x){int c=gc();int sgn=1;while(~c&&c<'0'|c>'9'){if(c=='-')sgn=-1;c=gc();}for(x=0;~c&&'0'<=c&&c<='9';c=gc())x=x*10+c-'0';x*=sgn;return ~c;} +struct debugger{template debugger& operator , (const T& v){cerr< void __stl_print__ (T &x) { // for all STL containers + cerr << "["; forstl (i, x) cerr << (i != x.begin () ? ", " : "") << *i; cerr << "]" << endl; +} +template inline T max (T &a, U &b) +{ + return a > b ? a : b; +} +template inline T min (T &a, U &b) +{ + return a < b ? a : b; +} +template inline T swap (T &a, U &b) +{ + T tmp = a; + a = b; + b = tmp; +} + + +#include +#include "imageloader.h" +#include "color.h" + +using namespace std; + +const float BOX_SIZE = 15.0f; +const float h = 1.f; //The length of each side of the cube +float _angle = 0; //The rotation of the box +GLuint _textureId,_textureId1,_textureId2,_textureId3; //The OpenGL id of the texture +GLUquadricObj *quad = gluNewQuadric(); +GLUquadricObj *quad1 = gluNewQuadric(); +void handleKeypress(unsigned char key, int x, int y) { + switch (key) { + case 27: //Escape key + exit(0); + } +} + +//Makes the image into a texture, and returns the id of the texture +GLuint loadTexture(Image* image) { + GLuint textureId; + glGenTextures(1, &textureId); + glBindTexture(GL_TEXTURE_2D, textureId); + glTexImage2D(GL_TEXTURE_2D, + 0, + GL_RGB, + image->width, image->height, + 0, + GL_RGB, + GL_UNSIGNED_BYTE, + image->pixels); + return textureId; +} + +void initRendering() { + glEnable(GL_DEPTH_TEST); + glEnable(GL_LIGHTING); + glEnable(GL_LIGHT0); + glEnable(GL_NORMALIZE); + glEnable(GL_COLOR_MATERIAL); + + Image* image = loadBMP("C:\\Users\\Sanim\\Desktop\\thesis\\Tajmahal_cg\\1.bmp"); + _textureId = loadTexture(image); + delete image; + + image = loadBMP("C:\\Users\\Sanim\\Desktop\\thesis\\Tajmahal_cg\\2.bmp"); + _textureId1 = loadTexture(image); + delete image; + + image = loadBMP("C:\\Users\\Sanim\\Desktop\\thesis\\Tajmahal_cg\\3.bmp"); + _textureId2 = loadTexture(image); + delete image; + + image = loadBMP("C:\\Users\\Sanim\\Desktop\\thesis\\Tajmahal_cg\\4.bmp"); + _textureId3 = loadTexture(image); + delete image; + + //Image* image = loadBMP("aust.bmp"); + //_textureId = loadTexture(image); + //delete image; +} + +void handleResize(int w, int h) { + glViewport(0, 0, w, h); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + gluPerspective(45.0, (float)w / (float)h, 1.0, 200.0); +} + +void TajFloor() { + glColor3d(White); + glBegin(GL_QUADS); + //Top face + glNormal3f(0.0, 1.0f, 0.0f); + glVertex3f(-BOX_SIZE / 2, h / 2, -BOX_SIZE / 2); + glVertex3f(-BOX_SIZE / 2, h / 2, BOX_SIZE / 2); + glVertex3f(BOX_SIZE / 2, h / 2, BOX_SIZE / 2); + glVertex3f(BOX_SIZE / 2, h / 2, -BOX_SIZE / 2); + + //Bottom face + + glNormal3f(0.0, -1.0f, 0.0f); + glVertex3f(-BOX_SIZE / 2, -h / 2, -BOX_SIZE / 2); + glVertex3f(BOX_SIZE / 2, -h / 2, -BOX_SIZE / 2); + glVertex3f(BOX_SIZE / 2, -h / 2, BOX_SIZE / 2); + glVertex3f(-BOX_SIZE / 2, -h / 2, BOX_SIZE / 2); + + //Left face + glNormal3f(-1.0, 0.0f, 0.0f); + glVertex3f(-BOX_SIZE / 2, -h / 2, -BOX_SIZE / 2); + glVertex3f(-BOX_SIZE / 2, -h / 2, BOX_SIZE / 2); + glVertex3f(-BOX_SIZE / 2, h / 2, BOX_SIZE / 2); + glVertex3f(-BOX_SIZE / 2, h / 2, -BOX_SIZE / 2); + + //Right face + glNormal3f(1.0, 0.0f, 0.0f); + glVertex3f(BOX_SIZE / 2, -h / 2, -BOX_SIZE / 2); + glVertex3f(BOX_SIZE / 2, h / 2, -BOX_SIZE / 2); + glVertex3f(BOX_SIZE / 2, h / 2, BOX_SIZE / 2); + glVertex3f(BOX_SIZE / 2, -h / 2, BOX_SIZE / 2); + + + + //Front face + glNormal3f(0.0, 0.0f, 1.0f); + glVertex3f(-BOX_SIZE / 2, -h / 2, BOX_SIZE / 2); + glVertex3f(BOX_SIZE / 2, -h / 2, BOX_SIZE / 2); + glVertex3f(BOX_SIZE / 2, h / 2, BOX_SIZE / 2); + glVertex3f(-BOX_SIZE / 2, h / 2, BOX_SIZE / 2); + + //Back face + glNormal3f(0.0, 0.0f, -1.0f); + glVertex3f(-BOX_SIZE / 2, -h / 2, -BOX_SIZE / 2); + glVertex3f(-BOX_SIZE / 2, h / 2, -BOX_SIZE / 2); + glVertex3f(BOX_SIZE / 2, h / 2, -BOX_SIZE / 2); + glVertex3f(BOX_SIZE / 2, -h / 2, -BOX_SIZE / 2); + glEnd(); +} + +void minarCenterCylinder(float a,float b) { + glEnable(GL_TEXTURE_2D); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glBindTexture(GL_TEXTURE_2D, _textureId3); + gluQuadricOrientation(quad, GLU_OUTSIDE); + gluQuadricNormals(quad, true); + gluQuadricTexture(quad, true); + glPushMatrix(); + glTranslated(a,0.0,b); + glRotated(90.,-1.,0.,0.); + gluCylinder(quad,0.8,0.6,7,8,1); + glPopMatrix(); +} + +void minarRings(float a,float b,float c) { + glPushMatrix(); + glTranslated(a,c,b); + glRotated(90.,-1.,0.,0.); + gluCylinder(quad,0.9,0.9,.25,8,1); + gluDisk(quad,0,0.9,50,1); + glPopMatrix(); + + glPushMatrix(); + glTranslated(a,c+.25,b); + glRotated(90.,-1.,0.,0.); + gluDisk(quad,0,0.9,50,1); + glPopMatrix(); +} + +void minarHead(float a,float b) { + glEnable(GL_TEXTURE_2D); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glBindTexture(GL_TEXTURE_2D, _textureId2); + gluQuadricOrientation(quad1, GLU_OUTSIDE); + gluQuadricNormals(quad1, true); + gluQuadricTexture(quad1, true); + glPushMatrix(); + glTranslated(a,7,b); + glRotated(90.,-1.,0.,0.); + gluCylinder(quad1,0.6,0.6,1.25,8,1); + glPopMatrix(); + + + + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + gluQuadricOrientation(quad, GLU_OUTSIDE); + gluQuadricNormals(quad, true); + gluQuadricTexture(quad, true); + glPushMatrix(); + glTranslated(a,8.25,b); + glRotated(90.,-1.,0.,0.); + gluDisk(quad,0,0.6,50,1); + glPopMatrix(); + + glPushMatrix(); + glTranslated(a,8.25,b); + glRotated(90.,-1.,0.,0.); + glutSolidSphere(0.6,50,50); + glPopMatrix(); + + glBindTexture(GL_TEXTURE_2D, _textureId3); + gluQuadricOrientation(quad, GLU_OUTSIDE); + gluQuadricNormals(quad, true); + gluQuadricTexture(quad, true); + glPushMatrix(); + glTranslated(a,8,b); + glRotated(90.,-1.,0.,0.); + glutSolidCone(0.9,.25,50,50); + gluDisk(quad,0,0.9,50,1); + glPopMatrix(); + + glBindTexture(GL_TEXTURE_2D, _textureId3); + gluQuadricOrientation(quad, GLU_OUTSIDE); + gluQuadricNormals(quad, true); + gluQuadricTexture(quad, true); + glPushMatrix(); + glColor3d(Gold); + glTranslated(a,8.25+.6,b); + glRotated(90.,-1.,0.,0.); + gluCylinder(quad,0.1,0.1,.25,8,1); + glPopMatrix(); + glColor3d(White); +} + + +void minar() { + + minarCenterCylinder(BOX_SIZE/2-.8,BOX_SIZE/2-.8); + minarRings(BOX_SIZE/2-.8,BOX_SIZE/2-.8,2.33); + minarRings(BOX_SIZE/2-.8,BOX_SIZE/2-.8,2.33*2); + minarRings(BOX_SIZE/2-.8,BOX_SIZE/2-.8,2.33*3); + minarHead(BOX_SIZE/2-.8,BOX_SIZE/2-.8); + + + minarCenterCylinder(-BOX_SIZE/2+.8,BOX_SIZE/2-.8); + minarRings(-BOX_SIZE/2+.8,BOX_SIZE/2-.8,2.33); + minarRings(-BOX_SIZE/2+.8,BOX_SIZE/2-.8,2.33*2); + minarRings(-BOX_SIZE/2+.8,BOX_SIZE/2-.8,2.33*3); + minarHead(-BOX_SIZE/2+.8,BOX_SIZE/2-.8); + + minarCenterCylinder(-BOX_SIZE/2+.8,-BOX_SIZE/2+.8); + minarRings(-BOX_SIZE/2+.8,-BOX_SIZE/2+.8,2.33); + minarRings(-BOX_SIZE/2+.8,-BOX_SIZE/2+.8,2.33*2); + minarRings(-BOX_SIZE/2+.8,-BOX_SIZE/2+.8,2.33*3); + minarHead(-BOX_SIZE/2+.8,-BOX_SIZE/2+.8); + + minarCenterCylinder(BOX_SIZE/2-.8,-BOX_SIZE/2+.8); + minarRings(BOX_SIZE/2-.8,-BOX_SIZE/2+.8,2.33); + minarRings(BOX_SIZE/2-.8,-BOX_SIZE/2+.8,2.33*2); + minarRings(BOX_SIZE/2-.8,-BOX_SIZE/2+.8,2.33*3); + minarHead(BOX_SIZE/2-.8,-BOX_SIZE/2+.8); + +} +double x = 6,y = 6; +void wall1() { + + glEnable(GL_TEXTURE_2D); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glBindTexture(GL_TEXTURE_2D, _textureId); + glBegin(GL_QUADS); + glNormal3f(0.0, 1.0f, 0.0f); + glTexCoord2f(0.f, 0.0f); + glVertex3f(-BOX_SIZE / 2 + x, h / 2 , BOX_SIZE / 2 - x); + glTexCoord2f(1.f, 0.f); + glVertex3f(-BOX_SIZE / 2 + x, h / 2 + y-1, BOX_SIZE / 2 - x); + glTexCoord2f(1.f, 1.f); + glVertex3f(BOX_SIZE / 2 - x, h / 2 + y-1, BOX_SIZE / 2 - x); + glTexCoord2f(0.f, 1.f); + glVertex3f(BOX_SIZE / 2 - x, h / 2, BOX_SIZE / 2 - x); + glEnd(); + + glPushMatrix(); + glTranslated(-BOX_SIZE / 2 + x+.1, h / 2+ y-1 , BOX_SIZE / 2 - x); + glColor3d(Gold); + glRotated(90.,-1.,0.,0.); + gluCylinder(quad,0.05,0.05,.50,8,1); + glColor3d(White); + glPopMatrix(); + + glPushMatrix(); + glTranslated(BOX_SIZE / 2 - x-.1, h / 2 + y-1, BOX_SIZE / 2 - x); + glColor3d(Gold); + glRotated(90.,-1.,0.,0.); + gluCylinder(quad,0.05,0.05,.50,8,1); + glColor3d(White); + glPopMatrix(); +} +double z = 2; +double _w2; +void wall2() { + glEnable(GL_TEXTURE_2D); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glBindTexture(GL_TEXTURE_2D, _textureId1); + glBegin(GL_QUADS); + glNormal3f(0.0, 1.0f, 0.0f); + glTexCoord2f(0.f, 0.0f); + glVertex3f(-BOX_SIZE / 2 + x, h / 2 , BOX_SIZE / 2 - x); + + glTexCoord2f(1.f, 0.0f); + glVertex3f(-BOX_SIZE / 2 + x, h / 2 + y - z, BOX_SIZE / 2 - x); + + glTexCoord2f(1.f, 1.0f); + glVertex3f(-BOX_SIZE / 2 + .75*x, h / 2 + y - z, BOX_SIZE / 2 - x); + //__(-BOX_SIZE / 2 + .75*x, h / 2 + y - z, BOX_SIZE / 2 - x); + + glTexCoord2f(0.f, 1.0f); + glVertex3f(-BOX_SIZE / 2 + .75*x, h / 2, BOX_SIZE / 2 - x); + glEnd(); +} + +void wall3() { + + glBindTexture(GL_TEXTURE_2D, _textureId1); + glBegin(GL_QUADS); + glNormal3f(0.0, 1.0f, 0.0f); + + glTexCoord2f(0.f, 0.0f); + glVertex3f(-BOX_SIZE / 2 + .75*x, h / 2, BOX_SIZE / 2 - x); + + glTexCoord2f(1.f, 0.0f); + glVertex3f(-BOX_SIZE / 2 + .75*x, h / 2 + y - z, BOX_SIZE / 2 - x); + + glTexCoord2f(1.f, 1.0f); + glVertex3f(-BOX_SIZE / 3.25 , h / 2 + y - z, BOX_SIZE / 2 - 1.25*x); + + + glTexCoord2f(0.f, 1.0f); + glVertex3f(-BOX_SIZE / 3.25, h / 2 , BOX_SIZE / 2 - 1.25*x); + + glEnd(); + + glPushMatrix(); + glTranslated(-BOX_SIZE / 2 + .75*x, h / 2 + y - z, BOX_SIZE / 2 - x-.1); + glColor3d(Gold); + glRotated(90.,-1.,0.,0.); + gluCylinder(quad,0.05,0.05,.50,8,1); + glColor3d(White); + glPopMatrix(); + + glPushMatrix(); + glTranslated(-BOX_SIZE / 3.25 , h / 2 + y - z, BOX_SIZE / 2 - 1.25*x-.1); + glColor3d(Gold); + glRotated(90.,-1.,0.,0.); + gluCylinder(quad,0.05,0.05,.50,8,1); + glColor3d(White); + glPopMatrix(); +} + +void centerBig(){ + glPushMatrix(); + glTranslated(0,5,-BOX_SIZE/5); + gluSphere(quad,2,50,50); + glBindTexture(GL_TEXTURE_2D, _textureId3); + gluQuadricOrientation(quad, GLU_OUTSIDE); + gluQuadricNormals(quad, true); + gluQuadricTexture(quad, true); + glTranslated(0,2,0); + glColor3d(Gold); + glRotated(90.,-1.,0.,0.); + gluCylinder(quad,0.05,0.05,.50,8,1); + glColor3d(White); + glPopMatrix(); +} + +void side(){ + + glPushMatrix(); + glTranslated(-3,4.75,-BOX_SIZE/2.75); + gluSphere(quad,1,50,50); + glTranslated(0,1,0); + glColor3d(Gold); + glRotated(90.,-1.,0.,0.); + gluCylinder(quad,0.05,0.05,.50,8,1); + glColor3d(White); + glPopMatrix(); + + glPushMatrix(); + glTranslated(BOX_SIZE/2.75,0,0); + glTranslated(-3,4.75,-BOX_SIZE/2.75); + gluSphere(quad,1,50,50); + glTranslated(0,1,0); + glColor3d(Gold); + glRotated(90.,-1.,0.,0.); + gluCylinder(quad,0.05,0.05,.25,8,1); + glColor3d(White); + glPopMatrix(); + + glPushMatrix(); + glTranslated(0,0,BOX_SIZE/2.75); + glTranslated(-3,4.75,-BOX_SIZE/2.75); + gluSphere(quad,1,50,50); + glTranslated(0,1,0); + glColor3d(Gold); + glRotated(90.,-1.,0.,0.); + gluCylinder(quad,0.05,0.05,.25,8,1); + glColor3d(White); + glPopMatrix(); + + glPushMatrix(); + glTranslated(BOX_SIZE/2.75,0,BOX_SIZE/2.75); + glTranslated(-3,4.75,-BOX_SIZE/2.75); + gluSphere(quad,1,50,50); + glTranslated(0,1,0); + glColor3d(Gold); + glRotated(90.,-1.,0.,0.); + gluCylinder(quad,0.05,0.05,.25,8,1); + glColor3d(White); + glPopMatrix(); + + +} + + +void house() { + + glPushMatrix(); + glTranslated(0,0,2); + wall1(); + wall2(); + glPushMatrix(); + glTranslated(BOX_SIZE/3.35,0,0); + wall2(); + glPopMatrix(); + + glPushMatrix(); + wall3(); + glPopMatrix(); + + glPushMatrix(); + rep(i,3) { + glTranslated(-3,0,-3); + glRotated(-90.,0,1,0); + wall1(); + wall2(); + glPushMatrix(); + glTranslated(BOX_SIZE/3.35,0,0); + wall2(); + glPopMatrix(); + wall3(); + } + glPopMatrix(); + glBindTexture(GL_TEXTURE_2D, _textureId3); + gluQuadricOrientation(quad, GLU_OUTSIDE); + gluQuadricNormals(quad, true); + gluQuadricTexture(quad, true); + centerBig(); + side(); + glPopMatrix(); + +} + +void dd(){ + glPushMatrix(); + glBegin(GL_QUADS); + glVertex3f(-BOX_SIZE/3.35 , h / 2 + y - z, BOX_SIZE / 6.45); + glVertex3f(BOX_SIZE / 3.35, h / 2 + y - z, BOX_SIZE / 6.45); + glVertex3f(BOX_SIZE/3.35, h / 2 + y - z, -BOX_SIZE / 3.5); + glVertex3f(-BOX_SIZE/3.35 , h / 2 + y - z, -BOX_SIZE /3.5); + glEnd(); + + glBegin(GL_QUADS); + glVertex3f(-BOX_SIZE/3.35 , h / 2 + y - z, BOX_SIZE / 6.45); + glVertex3f(BOX_SIZE / 3.35, h / 2 + y - z, BOX_SIZE / 6.45); + glVertex3f(BOX_SIZE / 2 - .75*x, h / 2 + y - z, BOX_SIZE / 4.35); + glVertex3f(-BOX_SIZE / 2 + .75*x, h / 2 + y - z , BOX_SIZE / 4.35); + glEnd(); + + glPushMatrix(); + + glTranslated(0,0,-BOX_SIZE/8); + glRotated(-180,0,1,0); + glBegin(GL_QUADS); + glVertex3f(-BOX_SIZE/3.35 , h / 2 + y - z, BOX_SIZE / 6.45); + glVertex3f(BOX_SIZE / 3.35, h / 2 + y - z, BOX_SIZE / 6.45); + glVertex3f(BOX_SIZE / 2 - .75*x, h / 2 + y - z, BOX_SIZE / 4.35); + glVertex3f(-BOX_SIZE / 2 + .75*x, h / 2 + y - z , BOX_SIZE / 4.35); + glEnd(); + glPopMatrix(); + + glPopMatrix(); +} + +void front(){ + +} + +void drawScene() { + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + + glTranslatef(0.0f, 0.0f, -40.0f); + + GLfloat ambientLight[] = {0.3f, 0.3f, 0.3f, 1.0f}; + glLightModelfv(GL_LIGHT_MODEL_AMBIENT, ambientLight); + + GLfloat lightColor[] = {0.7f, 0.7f, 0.7f, 1.0f}; + GLfloat lightPos[] = {-2 * BOX_SIZE, BOX_SIZE, 4 * BOX_SIZE, 1.0f}; + glLightfv(GL_LIGHT0, GL_DIFFUSE, lightColor); + glLightfv(GL_LIGHT0, GL_POSITION, lightPos); + + glEnable(GL_TEXTURE_2D); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glRotatef(-_angle, 0.0f, 1.0f, 0.0f); + TajFloor(); + minar(); + house(); + dd(); + + glutSwapBuffers(); +} + + +void update(int value) { + _angle += 1.0f; + if (_angle > 360) { + _angle -= 360; + } + glutPostRedisplay(); + glutTimerFunc(10, update, 0); +} + + +int main(int argc, char** argv) { + glutInit(&argc, argv); + glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH); + glutInitWindowSize(800, 800); + + glutCreateWindow("Tajmahal"); + initRendering(); + + glutDisplayFunc(drawScene); + glutKeyboardFunc(handleKeypress); + glutReshapeFunc(handleResize); + glutTimerFunc(25, update, 0); + + glutMainLoop(); + return 0; +} + + diff --git a/Computer-Graphics-lab-master/Tajmahal_cg/obj/Debug/main.o b/Computer-Graphics-lab-master/Tajmahal_cg/obj/Debug/main.o new file mode 100644 index 0000000000000000000000000000000000000000..a83c63bbfdbf028971a79a0f3960438095df3c2e GIT binary patch literal 76592 zcmeFa31C#!^*?^^%mhbBNJv0I5r!nPND`8eu*oJcEP{e8A_xv4nIr?*$V|c_A_^!G zQCwvFu(uT)4CFDa_3NL0Aw zdIINO#`;Y2vsHZkxL3zJOAvdq>y$$<%J~k;oNEWt))7vKH2eyQRZGrr~MA@(} zeb+-lWyC1H5OeW^yB-Q0l)nuIptWUQdRrE!S#7f@n=SLYx6KMJe)v%M@RKyurX7h4 z2DXp89v1fwzy)i=4u9r7D)XKlZ4d2yn=EbE;S<8nH?xj>hzZ&z1eqX5M?SNdGDs3= zBMpzhhJ6D;qEJ$hw$A&kZEk+R_Hk?YGlDDj@855^YYS7&Zk_kJSNL-hzR(svea?CN zW}&5Q-So(R?%!{lv~xnHRB2wO9BtTotc^#e_Gh#9TU0 z1R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ec3f.h b/Computer-Graphics-lab-master/Tajmahal_cg/vec3f.h new file mode 100644 index 0000000..7179625 --- /dev/null +++ b/Computer-Graphics-lab-master/Tajmahal_cg/vec3f.h @@ -0,0 +1,163 @@ +/* Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above notice and this permission notice shall be included in all copies + * or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +/* File for "Terrain" lesson of the OpenGL tutorial on + * www.videotutorialsrock.com + */ + + + +#ifndef VEC3F_H_INCLUDED +#define VEC3F_H_INCLUDED + +#include + +class Vec3f { + private: + float v[3]; + public: + Vec3f(); + Vec3f(float x, float y, float z); + + float &operator[](int index); + float operator[](int index) const; + + Vec3f operator*(float scale) const; + Vec3f operator/(float scale) const; + Vec3f operator+(const Vec3f &other) const; + Vec3f operator-(const Vec3f &other) const; + Vec3f operator-() const; + + const Vec3f &operator*=(float scale); + const Vec3f &operator/=(float scale); + const Vec3f &operator+=(const Vec3f &other); + const Vec3f &operator-=(const Vec3f &other); + + float magnitude() const; + float magnitudeSquared() const; + Vec3f normalize() const; + float dot(const Vec3f &other) const; + Vec3f cross(const Vec3f &other) const; +}; + +#include + +#include "vec3f.h" + +using namespace std; + +Vec3f::Vec3f() { + +} + +Vec3f::Vec3f(float x, float y, float z) { + v[0] = x; + v[1] = y; + v[2] = z; +} + +float &Vec3f::operator[](int index) { + return v[index]; +} + +float Vec3f::operator[](int index) const { + return v[index]; +} + +Vec3f Vec3f::operator*(float scale) const { + return Vec3f(v[0] * scale, v[1] * scale, v[2] * scale); +} + +Vec3f Vec3f::operator/(float scale) const { + return Vec3f(v[0] / scale, v[1] / scale, v[2] / scale); +} + +Vec3f Vec3f::operator+(const Vec3f &other) const { + return Vec3f(v[0] + other.v[0], v[1] + other.v[1], v[2] + other.v[2]); +} + +Vec3f Vec3f::operator-(const Vec3f &other) const { + return Vec3f(v[0] - other.v[0], v[1] - other.v[1], v[2] - other.v[2]); +} + +Vec3f Vec3f::operator-() const { + return Vec3f(-v[0], -v[1], -v[2]); +} + +const Vec3f &Vec3f::operator*=(float scale) { + v[0] *= scale; + v[1] *= scale; + v[2] *= scale; + return *this; +} + +const Vec3f &Vec3f::operator/=(float scale) { + v[0] /= scale; + v[1] /= scale; + v[2] /= scale; + return *this; +} + +const Vec3f &Vec3f::operator+=(const Vec3f &other) { + v[0] += other.v[0]; + v[1] += other.v[1]; + v[2] += other.v[2]; + return *this; +} + +const Vec3f &Vec3f::operator-=(const Vec3f &other) { + v[0] -= other.v[0]; + v[1] -= other.v[1]; + v[2] -= other.v[2]; + return *this; +} + +float Vec3f::magnitude() const { + return sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]); +} + +float Vec3f::magnitudeSquared() const { + return v[0] * v[0] + v[1] * v[1] + v[2] * v[2]; +} + +Vec3f Vec3f::normalize() const { + float m = sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]); + return Vec3f(v[0] / m, v[1] / m, v[2] / m); +} + +float Vec3f::dot(const Vec3f &other) const { + return v[0] * other.v[0] + v[1] * other.v[1] + v[2] * other.v[2]; +} + +Vec3f Vec3f::cross(const Vec3f &other) const { + return Vec3f(v[1] * other.v[2] - v[2] * other.v[1], + v[2] * other.v[0] - v[0] * other.v[2], + v[0] * other.v[1] - v[1] * other.v[0]); +} + +Vec3f operator*(float scale, const Vec3f &v) { + return v * scale; +} + +ostream &operator<<(ostream &output, const Vec3f &v) { + cout << '(' << v[0] << ", " << v[1] << ", " << v[2] << ')'; + return output; +} + + +#endif