History

Render a green plane with fog, per Grayson's request.

Andrzej Kapolka committed 13 years ago

Commit 03de2f31 parent 6d459123 files · +90 −3Browse files

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

Unified · Split

interface/src/Application.cpp+17−0
@@ -2893,6 +2893,23 @@ void Application::displaySide(Camera& whichCamera) { · 2892 unmodified lines
28932893
28942894 //draw a grid ground plane....
28952895 if (_renderGroundPlaneOn->isChecked()) {
2896+ // draw grass plane with fog
2897+ glEnable(GL_FOG);
2898+ const float FOG_COLOR[] = { 1.0f, 1.0f, 1.0f, 1.0f };
2899+ glFogfv(GL_FOG_COLOR, FOG_COLOR);
2900+ glFogi(GL_FOG_MODE, GL_EXP2);
2901+ glFogf(GL_FOG_DENSITY, 0.025f);
2902+ glPushMatrix();
2903+ const float GRASS_PLANE_SIZE = 256.0f;
2904+ glTranslatef(-GRASS_PLANE_SIZE * 0.5f, -0.01f, GRASS_PLANE_SIZE * 0.5f);
2905+ glScalef(GRASS_PLANE_SIZE, 1.0f, GRASS_PLANE_SIZE);
2906+ glRotatef(-90.0f, 1.0f, 0.0f, 0.0f);
2907+ glColor3ub(70, 134, 74);
2908+ const int GRASS_DIVISIONS = 40;
2909+ _geometryCache.renderSquare(GRASS_DIVISIONS, GRASS_DIVISIONS);
2910+ glPopMatrix();
2911+ glDisable(GL_FOG);
2912+
28962913 renderGroundPlaneGrid(EDGE_SIZE_GROUND_PLANE, _audio.getCollisionSoundMagnitude());
28972914 }
28982915 // Draw voxels

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t