Subversion Repositories gelsvn

Rev

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

Rev 67 Rev 94
Line 16... Line 16...
16
using namespace IMeshUtil;
16
using namespace IMeshUtil;
17
using namespace Util;
17
using namespace Util;
18
using namespace CGLA;
18
using namespace CGLA;
19
using namespace GFX;
19
using namespace GFX;
20
 
20
 
21
namespace 
21
//namespace 
22
{
22
//{
23
	GLViewController* view_ctrl;
23
	GLViewController* view_ctrl;
24
	int WINX=800, WINY=800;
24
	int WINX=800, WINY=800;
25
	int main_window; 
25
	int main_window; 
26
	int light_follows_cam=true;
26
	int light_follows_cam=true;
27
 
27
 
Line 40... Line 40...
40
		void print() const
40
		void print() const
41
		{
41
		{
42
			cout << x << endl;
42
			cout << x << endl;
43
		}
43
		}
44
	};
44
	};
45
}
45
//}
46
 
46
 
47
void draw_imesh(const ResourcePtr<TriMesh>& imesh)
47
void draw_imesh(const ResourcePtr<TriMesh>& imesh)
48
{
48
{
49
	glEnable(GL_COLOR_MATERIAL);
49
	glEnable(GL_COLOR_MATERIAL);
50
	glColorMaterial(GL_FRONT, GL_DIFFUSE);
50
	glColorMaterial(GL_FRONT, GL_DIFFUSE);
Line 258... Line 258...
258
	float r = 2.14036;
258
	float r = 2.14036;
259
	
259
	
260
	my_mesh->get_bsphere(c,r);
260
	my_mesh->get_bsphere(c,r);
261
	view_ctrl = new GLViewController(WINX,WINY, c,r);
261
	view_ctrl = new GLViewController(WINX,WINY, c,r);
262
 
262
 
263
 
-
 
264
	// --------------------------------------------------
263
	// --------------------------------------------------
265
	// GL Init
264
	// GL Init
266
	glMatrixMode(GL_PROJECTION);
265
	glMatrixMode(GL_PROJECTION);
267
	glLoadIdentity();
266
	glLoadIdentity();
268
	glMatrixMode(GL_MODELVIEW);
267
	glMatrixMode(GL_MODELVIEW);
Line 281... Line 280...
281
  glui->add_rotation( "Light direction", lights_rot );
280
  glui->add_rotation( "Light direction", lights_rot );
282
	glui->set_main_gfx_window( main_window );
281
	glui->set_main_gfx_window( main_window );
283
	GLUI_Master.set_glutIdleFunc( animate ); 
282
	GLUI_Master.set_glutIdleFunc( animate ); 
284
	glutTimerFunc(20, timer, 0); 
283
	glutTimerFunc(20, timer, 0); 
285
 
284
 
286
 
-
 
287
	glutMainLoop();
285
	glutMainLoop();
288
	return 0;
286
	return 0;
289
}
287
}
290
 
288