GEL  2
GEL is a library for Geometry and Linear Algebra
Public Member Functions
GLGraphics::SimpleTrackBall Class Reference

Simple trackball class. More...

#include <SimpleTrackBall.h>

List of all members.

Public Member Functions

 SimpleTrackBall (const CGLA::Vec3f &_center, float _r)
void gl_view () const
void get_view (CGLA::Vec3f &c, CGLA::Vec3f &e, CGLA::Vec3f &u)
void up_axis (char up)
void farther ()
void closer ()
void roll (int x, int y)
void set_center (const CGLA::Vec3f &_center)

Detailed Description

Simple trackball class.

Use it to let the mouse movement control the viewing transformation.

Typical usage: Construct the trackball as a global variable. Call the roll function from the GLUT mouse motion callback. Setup an idle callback which only calls glutPostRedisplay and call gl_view from the display function to set up the view transform.

Deficiencies: This trackball has many shortcomings. For instance you cannot pan but only zoom and rotate. Go fix those problems!


Constructor & Destructor Documentation

GLGraphics::SimpleTrackBall::SimpleTrackBall ( const CGLA::Vec3f _center,
float  _r 
) [inline]

Constructor. Call with the distance to the center.


Member Function Documentation

void GLGraphics::SimpleTrackBall::closer ( ) [inline]

Move closer. Typically called from the keyboard callback

void GLGraphics::SimpleTrackBall::farther ( ) [inline]

Move away. Typically called from the keyboard callback

void GLGraphics::SimpleTrackBall::gl_view ( ) const

Callthis to set up OpenGL viewing matrix. It will also clear the view matrix.

Call this to set up OpenGL viewing matrix. It will also clear the view matrix.

void GLGraphics::SimpleTrackBall::roll ( int  x,
int  y 
)

Roll ball. Call with the x,y coordinates. This function is typically called from GLUT's mouse motion callback.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations