Rotation Of Triangle | |||
|
This Project on Rotation Of Triangle is submitted by Anmol Sharma(BCET GSP) Rotation Of Triangle
#include<stdio.h> //void render(float,float,float, float,float,float, void main() L1: display(); while(ch1!=’4′) if(ch1==’1′) for(i=0;i<5;i++) if(ch1==’2′) tempy=(pts1[i][1]*cos(thita)+pts1[i][2]*sin(thita)); pts1[i][2]=(pts1[i][1]*sin(thita)-pts1[i][2]*cos(thita)); if(ch2==’2′) tempz=(pts1[i][2]*cos(thita)+pts1[i][0]*sin(thita)); pts1[i][0]=(pts1[i][2]*sin(thita)-pts1[i][0]*cos(thita)); if(ch2==’3′) thita=(alpha*3.142)/180; tempx=(pts1[i][0]*cos(thita)-pts1[i][1]*sin(thita)); pts1[i][1]=(pts1[i][0]*sin(thita)+pts1[i][1]*cos(thita)); } } void firstpage() call_first(); } void display(void) assign(pts[1][0],pts[1][1],pts[1][2],pts[2][0],pts[2][1],pts[2][2],pts[4][ assign(pts[2][0],pts[2][1],pts[2][2],pts[3][0],pts[3][1],pts[3][2],pts[4][ assign(pts[0][0],pts[0][1],pts[0][2],pts[4][0],pts[4][1],pts[4][2],pts[3][ assign(pt[1][0],pt[1][1],pt[1][2],pt[2][0],pt[2][1],pt[2][2],pt[4][0],pt[4 assign(pt[2][0],pt[2][1],pt[2][2],pt[3][0],pt[3][1],pt[3][2],pt[4][0],pt[4 assign(pt[0][0],pt[0][1],pt[0][2],pt[4][0],pt[4][1],pt[4][2],pt[3][0],pt[3 void drawpyramid(float x1,float y1,float x2,float y2,float x3,float y3) void assign(float x1,float y1,float z1,float x2,float y2,float z2,float A=y1*(z2-z3)+y2*(z3-z1)+y3*(z1-z2); temp=sqrt(A*A+B*B+C*C); X=(float)Xl/templ; Y=(float)Yl/templ; Z=(float)Zl/templ; intensity=15*(An*X+Bn*Y+Cn*Z); if (intensity<0) z1=55-z1; if(ch==’1′) if(ch==’4′) if(ch==’2′) if ((y1>y2) && (y1>y3) && (y3>y2)) if ((y2>y1) && (y2>y3) && (y1>y3)) if ((y2>y1) && (y2>y3) && (y3>y1)) if ((y3>y1) && (y3>y2) && (y1>y2)) if ((y3>y1) && (y3>y2) && (y2>y1)) void scan_line(float x1,float y1,float z1,float x2,float y2,float tempx=x1; tempx1=x1; tempy=y1; while((int)tempy!=(int)y2) m1=(float)(y3-y2)/(x3-x2); while((int)tempy!=(int)y3) void draw() Please do Like, Share, Send, Tweet, Stumble Upon this page to support us.
| |||
|
||||||
|
|
| |||||
|
© 2011-2012, IndiaExam.in SITE MAINTAINED BY tvich Technologies |
