Subversion Repositories gelsvn

Rev

Rev 660 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 660 Rev 661
Line 119... Line 119...
119
 
119
 
120
int main(int argc, char** argv)
120
int main(int argc, char** argv)
121
{
121
{
122
	// LOAD OBJ
122
	// LOAD OBJ
123
    Manifold m;
123
    Manifold m;
124
    string fn;
124
    string fn = "../../../data/bunny-little.x3d";
125
    if(argc>1)
125
    if(argc>1)
126
	{
126
	{
127
		ArgExtracter ae(argc, argv);
127
		ArgExtracter ae(argc, argv);
128
		
128
		
129
		do_aabb = ae.extract("-A");
129
		do_aabb = ae.extract("-A");
Line 133... Line 133...
133
		ae.extract("-z", vol_dim[2]);
133
		ae.extract("-z", vol_dim[2]);
134
		do_ray_tests = ae.extract("-R");
134
		do_ray_tests = ae.extract("-R");
135
		flip_normals = ae.extract("-f");
135
		flip_normals = ae.extract("-f");
136
		fn = ae.get_last_arg();
136
		fn = ae.get_last_arg();
137
    }
137
    }
138
    load(fn, m);
138
    if(!load(fn, m))
-
 
139
    {
-
 
140
        cout << "Failed to load mesh" << endl;
-
 
141
        exit(1);
139
    
142
    }
140
    string file_prefix = fn.substr(0, fn.length()-4) + "-";
143
    string file_prefix = fn.substr(0, fn.length()-4) + "-";
141
	cout << "Volume dimensions " << vol_dim << endl;
144
	cout << "Volume dimensions " << vol_dim << endl;
142
	if(!valid(m))
145
	if(!valid(m))
143
	{
146
	{
144
		cout << "Not a valid manifold" << endl;
147
		cout << "Not a valid manifold" << endl;
Line 146... Line 149...
146
	}
149
	}
147
	triangulate_by_edge_face_split(m);
150
	triangulate_by_edge_face_split(m);
148
	
151
	
149
	Vec3d p0, p7;
152
	Vec3d p0, p7;
150
	bbox(m, p0, p7);
153
	bbox(m, p0, p7);
-
 
154
 
-
 
155
  cout << p0 << endl;
-
 
156
  cout << p7 << endl;
151
	
157
	
152
	Mat4x4d T = fit_bounding_volume(p0,p7,10);
158
	Mat4x4d T = fit_bounding_volume(p0,p7,10);
153
    
159
    
154
    cout << "Transformation " << T << endl;
160
    cout << "Transformation " << T << endl;
155
	
161