Files Classes Functions Hierarchy
00001 #include <random.h> 00002 00003 #include <pointgrid3Dbilineardraw.h> 00004 00005 pointgrid3Dbilineardraw::pointgrid3Dbilineardraw 00006 ( 00007 pointgrid3D const & pg_ 00008 ) 00009 : row(0), col(0), pg(pg_), mp(1,1) 00010 { 00011 pointsdisplay=true; 00012 pointsperpatch=2000; 00013 00014 quadric.radius = 0.02; 00015 quadric.slices=20; 00016 quadric.loops=6; 00017 00018 } 00019 00020 00021 void pointgrid3Dbilineardraw::update() 00022 { 00023 nuke(); 00024 00025 push( new gobjglPushAttrib(GL_LIGHTING) ); 00026 push( new gobjglPushAttrib(GL_CURRENT_BIT) ); 00027 00028 push(new gobjglDisable(GL_LIGHTING) ); 00029 00030 //push( new gobjglColor3ub(255,165,0) ); 00031 00032 random11<double> r; 00033 00034 point3<double> p; 00035 00036 push( new gobjglBegin(GL_POINTS) ); 00037 00038 row=0; 00039 col=0; 00040 for (uint k=0; k+1<pg.N; ++k) 00041 { 00042 for (uint i=0; i+1<pg.M; ++i) 00043 { 00044 //cout << SHOW(row) << " " << SHOW(col) << endl; 00045 00046 push( new gobjglColor3ub(rand()%256,rand()%165,rand()%256) ); 00047 00048 for (uint a=0; a<pointsperpatch; ++a) 00049 { 00050 mp.eval(p,r(),r(),*this); 00051 push( new gobjglVertex3f(p) ); 00052 } 00053 ++col; 00054 } 00055 ++row; 00056 col=0; 00057 } 00058 00059 /* 00060 for (uint i=0; i<pointsperpatch; ++i) 00061 { 00062 mp.eval(p,r(),r(),*this); 00063 push( new gobjglVertex3f(p) ); 00064 } 00065 00066 ++col; 00067 00068 for (uint i=0; i<pointsperpatch; ++i) 00069 { 00070 mp.eval(p,r(),r(),*this); 00071 push( new gobjglVertex3f(p) ); 00072 } 00073 */ 00074 00075 00076 00077 push( new gobjglEnd() ); 00078 00079 push( new gobjglPopAttrib() ); 00080 push( new gobjglPopAttrib() ); 00081 } 00082 00083 00084
1.5.8