An instance represents a camera. An instance of class Camera
is used to control the view. The function Camera::apply()
calls gluLookAt()
with appropriate parameters. The other functions of this class set up these parameters.
Camera movements may be smooth (interlpolated between end points) or abrupt. The function Camera::setMode() determines the kind of movement. Smooth transitions are obtained by calling Camera::idle()
in the GLUT idle callback function, together with the various camera movement functions. All derived class must implement at least two virtual functions BaseCamera::idle()
which will typically be called in the callback function for glutIdleFunc, i.e. within callback function "idle()" DerivedClass::idle() will be called and later in "main" callback "idle()" will be called as parameter to "glutIdleFunc". void idle() { DerivedClass::idle();} int main() { ... glutIdleFunc(idle); ...} BaseCamera::apply() const
. Similarly inside callback function for "glutDisplayFunc", say "display()", DerivedClass::apply() will be called. i.e. void display() { DerivedClass::apply();..} int main(){...glutDisplayFunc(display); ...}
Definition at line 1589 of file cugl.h.
virtual void cugl::BaseCamera::update |
( |
| ) |
|
|
inlinevirtual |
This function is just a suggested wrapper for all derived class for initializations, such as set up first and last position for motions in /c Interpolator, or set up new eye and view parameter for /c Camera. I don't want to force new class to wrap their initialization actions within this function, so, I don't make this method as abstract one. (added by nick)
Reimplemented in cugl::Interpolator.
Definition at line 1631 of file cugl.h.