1 #include <GLviewer/Scenes/SceneGridGround.hh>
2 #include <GLviewer/GLProjectionParametersInterface.hh>
21 Resize(
double from,
double to,
double gridSize,
double z)
29 const double extent = fabs(z);
55 glPushAttrib(GL_LIGHTING);
56 glDisable(GL_LIGHTING);
59 glMatrixMode(GL_MODELVIEW);
63 memset((
void*)m, 0, 16*
sizeof(
double));
64 m[0] = 1; m[6] = 1; m[9] = -1; m[15] = 1;
80 if (x == 0 && y == 0) {
81 glColor3f(1.0,0.0,0.0);
85 glColor3f(0.0,1.0,0.0);
87 glColor3f(0.0,0.0,1.0);
92 if (col < 0.0) col = 0.0;
93 glColor3f(col*
colorR_+(1.0-col)*bgcolor[0],
94 col*
colorG_+(1.0-col)*bgcolor[1],
95 col*
colorB_+(1.0-col)*bgcolor[2]);
97 col = 1.0 - sqrt(x*x+y*y) / (to_-
from_ )*2.0;
98 if (col < 0.0) col = 0.0;
99 glColor3f(col*
colorR_+(1.0-col)*bgcolor[0],
100 col*
colorG_+(1.0-col)*bgcolor[1],
101 col*
colorB_+(1.0-col)*bgcolor[2]);
105 if (col < 0.0) col = 0.0;
106 glColor3f(col*
colorR_+(1.0-col)*bgcolor[0],
107 col*
colorG_+(1.0-col)*bgcolor[1],
108 col*
colorB_+(1.0-col)*bgcolor[2]);
virtual void GetBoundingBox(BIAS::Vector3< double > &minVal, BIAS::Vector3< double > &maxVal)
Implementation of the SceneBase GetBoundingBox method.
virtual BIAS::Vector4< float > GetClearColor()=0
Abstract interface class to handle changes in rendering parameters by controllers and in rendering co...
virtual void Draw()
Implementation of the SceneBase Draw method.
SceneGridGround(double from=-1000.0, double to=1000.0, double gridSize=50.0, double z=0.0)
Create a square grid ground from position (from, from, z) to position (to, to, z) at constant z value...
void DrawInXYPlane(bool xyplane)
Specify if grid ground is parallel to x/y plane or x/z plane.
virtual GLProjectionParametersInterface * GetGLProjectionParametersInterface()
Get the camera as projectionparametersinterface, can be of type GLProjection of of any from GLProject...
void Resize(double from=-1000.0, double to=1000.0, double gridSize=50.0, double z=0.0)
Initialize the square ground.
void SetColor(float r, float g, float b)
Set the color of the grid ground.
BIAS::Vector3< double > boundingBoxMin_
BIAS::Vector3< double > boundingBoxMax_