[GtkGLExt] example/shapes.c bug



Hello. There is a bug in examples/shapes.c. The arcball/trackball
works better when the quatrics update q = q + qdiff is in the
motion-notify callback. Currently the trackball does not work well
when the time spend in expose_event() is relatively high: trackball's
behaviour depends on the drawing area size and on the object
complexity. That is bad.

Changes in expose_event():

  if (animate) add_quats (view_quat_diff, view_quat, view_quat);

Changes in motion_notify_event():

      trackball (view_quat_diff,
                 (2.0 * begin_x - w) / w,
                 (h - 2.0 * begin_y) / h,
                 (2.0 * x - w) / w,
                 (h - 2.0 * y) / h);
      add_quats (view_quat_diff, view_quat, view_quat);

If teapot draws too fast for you even at largest window size,
then pick up my modified shapes.c which includes the bunny.
It is at "http://www.funet.fi/~kouhia/shapes.tar.gz";

Getting the bunny to animate is hard. I guess it would require that
OpenGL drawing is done in other thread than the thread where
the pointer events are handled.

Juhana



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]