29 fLightState(kLightMask),
32 fFrontPower(0.4), fSidePower(0.7), fSpecularPower(0.8)
45 Error(
"TGLLightSet::ToggleLight",
"invalid light type");
60 Error(
"TGLViewer::ToggleLight",
"invalid light type");
93 frontLightZ = sideLightsZ;
101 sideLightsZ = eyeVector.
Mag() * -0.85;
102 frontLightZ = 0.2 * lightRadius;
123 const Float_t specLightColor[] = { specular, specular, specular, 1.0f };
125 glLightfv(GL_LIGHT0, GL_POSITION, pos0);
126 glLightfv(GL_LIGHT0, GL_DIFFUSE, frontLightColor);
127 glLightfv(GL_LIGHT0, GL_SPECULAR, specLightColor);
129 glLightfv(GL_LIGHT1, GL_POSITION, pos1);
130 glLightfv(GL_LIGHT1, GL_DIFFUSE, sideLightColor);
131 glLightfv(GL_LIGHT2, GL_POSITION, pos2);
132 glLightfv(GL_LIGHT2, GL_DIFFUSE, sideLightColor);
133 glLightfv(GL_LIGHT3, GL_POSITION, pos3);
134 glLightfv(GL_LIGHT3, GL_DIFFUSE, sideLightColor);
135 glLightfv(GL_LIGHT4, GL_POSITION, pos4);
136 glLightfv(GL_LIGHT4, GL_DIFFUSE, sideLightColor);
146 glEnable(GLenum(GL_LIGHT0 + light));
152 glDisable(GL_LIGHTING);
154 glGetLightfv(GLenum(GL_LIGHT0 + light), GL_POSITION, position);
156 TGLVertex3 dPosition(position[0], position[1], position[2]);
158 glEnable(GL_LIGHTING);
163 glDisable(GLenum(GL_LIGHT0 + light));
Abstract base camera class - concrete classes for orthographic and perspective cameras derive from it...
void SetLight(ELight light, Bool_t on)
Set a light on/off.
void MultiplyIP(TGLVector3 &v, Double_t w=1) const
Multiply vector in-place.
static const UChar_t fgYellow[4]
TGLVertex3 EyePoint() const
Return the camera eye point (vertex) in world space Camera must have valid frustum cache - call Apply...
void ToggleLight(ELight light)
Toggle light on/off.
TGLVertex3 Center() const
Encapsulates a set of lights for OpenGL.
Float_t fSidePower
power of the front lamp
Double_t DistanceTo(const TGLVertex3 &vertex) const
Distance from plane to vertex.
3 component (x/y/z) vertex class.
static void DrawSphere(const TGLVertex3 &position, Double_t radius, const UChar_t rgba[4])
Draw sphere, centered on vertex 'position', with radius 'radius', color 'rgba'.
3 component (x/y/z) vector class.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
TGLVector3 Extents() const
Bool_t fUseSpecular
light states (on/off) mask
const TGLMatrix & RefModelViewMatrix() const
Orthographic projection camera.
Mother of all ROOT objects.
Concrete class describing an orientated (free) or axis aligned box of 8 vertices. ...
TGLVertex3 FrustumCenter() const
Find the center of the camera frustum from intersection of planes This method will work even with par...
ClassImp(TGLLightSet) TGLLightSet
const TGLPlane & FrustumPlane(EFrustumPlane plane) const
Float_t fSpecularPower
power of the side lamps
void StdSetupLights(const TGLBoundingBox &bbox, const TGLCamera &camera, Bool_t debug=kFALSE)
Setup lights for current given bounding box and camera.