PDA

View Full Version : OpenGL control points



jhearon
28th October 2007, 19:42
Hi,
I'm trying to recreate the Mark Kilgard editgrid.c example using QT4. The .cpp and .pro files should be attached. He draws an opengl grid and the mouse can interact directly with with the control points (in the glut window) to move the grid. His example deforms the grid, and doesn't use simple rotation such as the gears or opengl grabber exs.

I can draw the grid, and print control point hits to the console by selecting control points with the mouse, but I cannot seem to figure out how to get the grid to move.

myglwidget.cpp tries to preserve his original c functions by creating cpp vers of those, and then calling them from QT's paintGL, resizeGL, etc.

Any help really appreciated.
Thanks.

jhearon
3rd November 2007, 19:32
I'm updating my own query. After working on this example more, I discovered the motion(int x, int y) function called in main of the editgrid.c glut example, was not being called in the QT version I tried to port. Thus motion needs to be included in QT's QMouseEvent function in order for the mouse to deform the grid.