History

#19171 merge with master

vincent committed 13 years ago

Commit cd1aa992 parents 4dbff46 5d1f11e9 files · +336 −236Browse files

Showing the changes to interface/src/Util.cpp (1 of 9 files). Show all

Unified · Split

interface/src/Util.cpp+35−2
@@ -46,9 +46,9 @@ void render_vector(glm::vec3 * vec) · 45 unmodified lines
4646 glVertex3f(vec->x, vec->y, vec->z);
4747 // Draw marker dots for magnitude
4848 glEnd();
49− float particle_attenuation_quadratic[] = { 0.0f, 0.0f, 2.0f }; // larger Z = smaller particles
49+ float particleAttenuationQuadratic[] = { 0.0f, 0.0f, 2.0f }; // larger Z = smaller particles
5050
51− glPointParameterfvARB( GL_POINT_DISTANCE_ATTENUATION_ARB, particle_attenuation_quadratic );
51+ glPointParameterfvARB( GL_POINT_DISTANCE_ATTENUATION_ARB, particleAttenuationQuadratic );
5252
5353 glEnable(GL_POINT_SMOOTH);
5454 glPointSize(10.0);
@@ -173,3 +173,36 @@ glm::vec3 operator* (const glm::vec3& lhs, float rhs) · 118 unmodified lines
173173 return result;
174174 }
175175
176+
177+
178+void drawGroundPlaneGrid( float size, int resolution )
179+{
180+
181+ glColor3f( 0.4f, 0.5f, 0.3f );
182+ glLineWidth(2.0);
183+
184+ float gridSize = 10.0;
185+ int gridResolution = 10;
186+
187+ for (int g=0; g<gridResolution; g++)
188+ {
189+ float fraction = (float)g / (float)( gridResolution - 1 );
190+ float inc = -gridSize * ONE_HALF + fraction * gridSize;
191+ glBegin( GL_LINE_STRIP );
192+ glVertex3f( inc, 0.0f, -gridSize * ONE_HALF );
193+ glVertex3f( inc, 0.0f, gridSize * ONE_HALF );
194+ glEnd();
195+ }
196+
197+ for (int g=0; g<gridResolution; g++)
198+ {
199+ float fraction = (float)g / (float)( gridResolution - 1 );
200+ float inc = -gridSize * ONE_HALF + fraction * gridSize;
201+ glBegin( GL_LINE_STRIP );
202+ glVertex3f( -gridSize * ONE_HALF, 0.0f, inc );
203+ glVertex3f( gridSize * ONE_HALF, 0.0f, inc );
204+ glEnd();
205+ }
206+}
207+
208+