-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcube14.cpp
More file actions
59 lines (45 loc) · 1.37 KB
/
cube14.cpp
File metadata and controls
59 lines (45 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*
* Following program reads input from cube.obj file
* and then scales and rotates the cube according to input
* and generates .svg file
* Author: Mahendra Chouhan (14CS60R12)
* */
#include <iostream>
#include <math.h>
#include <fstream>
#include <stdlib.h>
#include "src/graphics.h"
using namespace std;
int main(int argc,char *argv[])
{
Cube c("cube.txt");
if(argc < 6)
{
//c.Rotate(210,30,30);
c.Scale(3.2);
c = c.Project(Point3D(600,600,100));
c.writeHidden("projectHidden.svg");
}
else
{
//float S = atof(argv[1]);
Point3D orig(atof(argv[1]),atof(argv[2]),atof(argv[3]));
float degx = atoi(argv[4]);
float degy = atoi(argv[5]);
float degz = atoi(argv[6]);
c.Rotate(degx,degy,degz);
c.Move(orig);
//c.Scale();
c.writeHidden("realCubeH.svg");
c.write("realCube.svg");
c = c.Project(Point3D(600,600,100));
c.writeHidden("projectHidden.svg");
c.write("project.svg");
}
//c.write("cube.svg");
//ofstream out("single_cube.obj");
//~ if( fork() == 0)
//~ system("eog cube.svg");
//system("eog projectHidden.svg");
return 0;
}