glutMotionFunc

set the motion and passive motion callbacks respectively for the current window.

Signature

glutMotionFunc( )-> void
glutMotionFunc( function )
Specify handler for GLUT 'Motion' events
    def handler( (int) x, (int) y ):
        return None
glutPassiveMotionFunc( )-> void
glutPassiveMotionFunc( function )
Specify handler for GLUT 'PassiveMotion' events
    def handler( (int) x, (int) y ):
        return None

Parameters

VariablesDescription
func
The new motion or passive motion callback function.

Description

glutMotionFunc and glutPassiveMotionFunc set the motion and passive motion callback respectively for the current window. The motion callback for a window is called when the mouse moves within the window while one or more mouse buttons are pressed. The passive motion callback for a window is called when the mouse moves within the window while no mouse buttons are pressed.
The x and y callback parameters indicate the mouse location in window relative coordinates.
Passing NULL to glutMotionFunc or glutPassiveMotionFunc disables the generation of the mouse or passive motion callback respectively.

See Also

glutMouseFunc glutSpaceballMotionFunc glutTabletMotionFunc

Sample Code References

The following code samples have been found which appear to reference the functions described here. Take care that the code may be old, broken or not even use PyOpenGL.

glutMotionFunc
OpenGLContext OpenGLContext/glutcontext.py Lines: 115, 117
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson48/NeHeGL.py Lines: 161
OpenGL-Demo PyOpenGL-Demo/GLE/maintest.py Lines: 32, 38
{Artistic License} PymmLib pymmlib/applications/glutviewer.py Lines: 407
{LGPL} PyUI2 renderers/openglGlut.py Lines: 59
{LGPL} PyUI2 system/glutdevice.py Lines: 56
{LGPL} PyMT pymt/ui/window/win_glut.py Lines: 18, 43
{GPL3} OpenGL-Programmable 05-shader.py Lines: 317
{GPL3} OpenGL-Programmable 07-attrib.py Lines: 336
{GPL3} OpenGL-Programmable 03-array.py Lines: 237
{GPL3} OpenGL-Programmable 09-gles2.py Lines: 379
{GPL3} OpenGL-Programmable 06-perpixel.py Lines: 325
{GPL3} OpenGL-Programmable 10-gl3.2core.py Lines: 389
{GPL3} OpenGL-Programmable 02-displaylist.py Lines: 235
{GPL3} OpenGL-Programmable 04-vbo.py Lines: 256
{GPL3} OpenGL-Programmable 01-direct.py Lines: 226
{GPL3} OpenGL-Programmable 08-pbo.py Lines: 358
glutPassiveMotionFunc
OpenGLContext OpenGLContext/glutcontext.py Lines: 120, 122
{LGPL} PyUI2 renderers/openglGlut.py Lines: 60
{LGPL} PyUI2 system/glutdevice.py Lines: 57