Lab Manual - Virtual University of Pakistan



Lab ManualCS602 – Computer Graphics2139950-103759000Prepared byMuhmmad Umar Farooq, Instructor CS Department of Computer Science, Virtual University of Pakistan Week No.Lab TopicPage No.5Lab 13:Understanding the basic concepts of 3D coordinate system. 1Lab 14:Mathematical foundation of 3D transformation.1Lab 15:Write the C++ program that perform the scaling of 3D object1Lab 13Understanding the basic concepts of 3D coordinate system. Mechanism to Conduct Lab: Lab Session will be communicated through Skype / Adobe Connect session.Lab 14Mathematical foundation of 3D transformation. Mechanism to Conduct Lab: Lab Session will be communicated through Skype / Adobe Connect session.Lab 15Write the C program that will draw the table and perform all three. transformation i.e. translation, scaling and rotation.#include<graphics.h>#include<stdlib.h>#include<stdio.h>#include<iostream.h>int main(void){int gdriver=DETECT,gmode,errorcode;int midx,midy,i,sx,sy,sz;initgraph(&gdriver,&gmode,"");errorcode=graphresult();if (errorcode != grOk) /* an error occurred */{cout<<"Press any key to halt:";getch();exit(1); /* return with error code */}midx=getmaxx()/2;midy=getmaxy()/2;bar3d(midx-50,midy-50,midx+50,midy+50,10,1);getch();cleardevice();cout<<"\nEnter sx,sy,sz:";cin>>sx>>sy>>sz;bar3d(midx-50*sx,midy-50*sy,midx+50*sx,midy+50*sy,10*sx,1);getch();closegraph();getch();return 0;}Mechanism to Conduct Lab: Lab Session will be communicated through Skype / Adobe Connect session. As in computer graphics all the programs are implemented through Dev C++. During lab session students programming question are incorporated either through direct answers or through some sort of tutorials that are already uploaded at VULMS.For 64-bit windows install the following version of Dev-CPP. adding graphics library in 64-bit version of Dev-CPP see the link that illustrates the steps. 32-bit windows you can install the following version of Dev-CPP. case you have 32 windows, you are required to follow the instruction as given in the following document. for 32-bit platform, you can download the graphics library from following link. ................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download