17#include "TGLIncludes.h"
44 Error(
"TGLLightSet::ToggleLight",
"invalid light type");
59 Error(
"TGLViewer::ToggleLight",
"invalid light type");
92 frontLightZ = sideLightsZ;
100 sideLightsZ = eyeVector.
Mag() * -0.85;
101 frontLightZ = 0.2 * lightRadius;
122 const Float_t specLightColor[] = { specular, specular, specular, 1.0f };
124 glLightfv(GL_LIGHT0, GL_POSITION, pos0);
125 glLightfv(GL_LIGHT0, GL_DIFFUSE, frontLightColor);
126 glLightfv(GL_LIGHT0, GL_SPECULAR, specLightColor);
128 glLightfv(GL_LIGHT1, GL_POSITION, pos1);
129 glLightfv(GL_LIGHT1, GL_DIFFUSE, sideLightColor);
130 glLightfv(GL_LIGHT2, GL_POSITION, pos2);
131 glLightfv(GL_LIGHT2, GL_DIFFUSE, sideLightColor);
132 glLightfv(GL_LIGHT3, GL_POSITION, pos3);
133 glLightfv(GL_LIGHT3, GL_DIFFUSE, sideLightColor);
134 glLightfv(GL_LIGHT4, GL_POSITION, pos4);
135 glLightfv(GL_LIGHT4, GL_DIFFUSE, sideLightColor);
145 glEnable(GLenum(GL_LIGHT0 + light));
151 glDisable(GL_LIGHTING);
153 glGetLightfv(GLenum(GL_LIGHT0 + light), GL_POSITION, position);
155 TGLVertex3 dPosition(position[0], position[1], position[2]);
157 glEnable(GL_LIGHTING);
162 glDisable(GLenum(GL_LIGHT0 + light));
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
bool Bool_t
Boolean (0=false, 1=true) (bool).
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
float Float_t
Float 4 bytes (float).
double Double_t
Double 8 bytes.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void on
Concrete class describing an orientated (free) or axis aligned box of 8 vertices.
TGLVector3 Extents() const
TGLVertex3 Center() const
Abstract base camera class - concrete classes for orthographic and perspective cameras derive from it...
TGLVertex3 FrustumCenter() const
Find the center of the camera frustum from intersection of planes This method will work even with par...
const TGLMatrix & RefModelViewMatrix() const
const TGLPlane & FrustumPlane(EFrustumPlane plane) const
TGLVertex3 EyePoint() const
Return the camera eye point (vertex) in world space Camera must have valid frustum cache - call Apply...
Float_t fFrontPower
! power of the front lamp
void StdSetupLights(const TGLBoundingBox &bbox, const TGLCamera &camera, Bool_t debug=kFALSE)
Setup lights for current given bounding box and camera.
void ToggleLight(ELight light)
Toggle light on/off.
Float_t fSidePower
! power of the side lamps
Float_t fSpecularPower
! power of specular lamp
void SetLight(ELight light, Bool_t on)
Set a light on/off.
UInt_t fLightState
! light states (on/off) mask
void MultiplyIP(TGLVector3 &v, Double_t w=1) const
Multiply vector in-place.
Orthographic projection camera.
Double_t DistanceTo(const TGLVertex3 &vertex) const
Distance from plane to vertex.
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'.
static const UChar_t fgYellow[4]
3 component (x/y/z) vector class.
3 component (x/y/z) vertex class.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
TObject()
TObject constructor.