Add to Favorites    Make Home Page 51240 Online  
 Language Categories  
 Our Services  

Home » C Home » Games and Graphics Home » 3D Transformations

A D V E R T I S E M E N T

Search Projects & Source Codes:

Title 3D Transformations
Author Priyanka Singh
Author Email lovelypinki [at] gmail.com
Description
Category C » Games and Graphics
Hits 420030
Code Select and Copy the Code
#include<stdio.h> #include<conio.h> #include<graphics.h> #include<math.h> int maxx,maxy,midx,midy; void axis() { getch(); cleardevice(); line(midx,0,midx,maxy); line(0,midy,maxx,midy); } void main() { int gd,gm,x,y,z,o,x1,x2,y1,y2; detectgraph(&gd,&gm); initgraph(&gd,&gm,"e:\tc\bgi"); setfillstyle(0,getmaxcolor()); maxx=getmaxx(); maxy=getmaxy(); midx=maxx/2; midy=maxy/2; axis(); bar3d(midx+50,midy-100,midx+60,midy-90,5,1); printf("Enter translation factor "); scanf("%d%d",&x,&y); axis(); printf("After translation: "); bar3d(midx+x+50,midy-(y+100),midx+x+60,midy-(y+90),5,1); axis(); bar3d(midx+50,midy-100,midx+60,midy-90,5,1); printf("Enter scaling factors "); scanf("%d%d%d", &x,&y,&z); axis(); printf("After scaling "); bar3d(midx+(x*50),midy-(y*100),midx+(x*60),midy-(y*90),5*z,1); axis(); bar3d(midx+50,midy-100,midx+60,midy-90,5,1); printf("Enter rotating angle " ); scanf("%d",&o); x1=50*cos(o*3.14/180)-100*sin(o*3.14/180); y1=50*sin(o*3.14/180)+100*cos(o*3.14/180); x2=60*cos(o*3.14/180)-90*sin(o*3.14/180); y2=60*sin(o*3.14/180)+90*cos(o*3.14/180); axis(); printf("After rotation about z axis " ); bar3d(midx+x1,midy-y1,midx+x2,midy-y2,5,1); axis(); printf("After rotation about x axis "); bar3d(midx+50,midy-x1,midx+60,midy-x2,5,1); axis(); printf("After rotation about yaxis "); bar3d(midx+x1,midy-100,midx+x2,midy-90,5,1); getch(); closegraph(); }

Related Source Codes

Script Name Author
The Game Opposite as seen on Nokia 2300 Mobile Manikanta
RECURSIVE BALANCED QUICK SORT ashish
Radix Sort ashish
Change your mouse pointer Ashim
The blinking star Shashank
Data Validation Crylittlebaby
To search a file by giving file type like mp3 or mpeg or doc Prashanth SR
Menus Demonstration B.Chidhambaram
Employee Database Project Using C. Reenku Raman Nayak
Creating a Lexical Analyzer in c fahad bader al-buhairi ¦Õ¤ ?¤Ð Ãß??ÝÐÝ
Calendar Program Omkar & Devendra
Stop double Process for start in C Cedrik Jurak
Stop double Process for start in C Cedrik Jurak
Time Scheduler Atiq Anwar
A timepass game between atmost two players Rahul Roy

A D V E R T I S E M E N T




Google Groups Subscribe to SourceCodesWorld - Techies Talk
Email:

Free eBook - Interview Questions: Get over 1,000 Interview Questions in an eBook for free when you join JobsAssist. Just click on the button below to join JobsAssist and you will immediately receive the Free eBook with thousands of Interview Questions in an ebook when you join.

New! Click here to Add your Code!


ASP Home | C Home | C++ Home | COBOL Home | Java Home | Pascal Home
Source Codes Home Page

 Advertisements  

Google Search

Google

Source Codes World.com is a part of Vyom Network.

Vyom Network : Web Hosting | Dedicated Server | Free SMS, GRE, GMAT, MBA | Online Exams | Freshers Jobs | Software Downloads | Interview Questions | Jobs, Discussions | Placement Papers | Free eBooks | Free eBooks | Free Business Info | Interview Questions | Free Tutorials | Arabic, French, German | IAS Preparation | Jokes, Songs, Fun | Free Classifieds | Free Recipes | Free Downloads | Bangalore Info | Tech Solutions | Project Outsourcing, Web Hosting | GATE Preparation | MBA Preparation | SAP Info | Software Testing | Google Logo Maker | Freshers Jobs

Sitemap | Privacy Policy | Terms and Conditions | Important Websites
Copyright ©2003-2024 SourceCodesWorld.com, All Rights Reserved.
Page URL: http://www.sourcecodesworld.com/source/show.asp?ScriptID=1214


Download Yahoo Messenger | Placement Papers | Free SMS | C Interview Questions | C++ Interview Questions | Quick2Host Review