Using Mouseevent together with Keypressedevents with OPENGL&QT
-
Hello,
has anybody an idea how can use the "Mousemove event" together with an "Keypress event" for example "Z"-key to change the viewport settings.
I am using the following example (glwidget.cpp Example File):
@
void GLWidget::resizeGL(int width, int height) {
int side = qMin(width, height);
glViewport((width - side) / 2, (height - side) / 2, side, side);glMatrixMode(GL_PROJECTION); glLoadIdentity(); glFrustum(-1.0, +1.0, -1.0, 1.0, near, far); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glTranslated(0.0, 0.0, -40.0);
}@
The aim of this (for me frustating) game is to change the to variable "far" and or "near" in an similar mode like in CAD-Systems. a mouse move together with a pressed key.
Thank you for your help
-
welcome to devnet
Please use "code wrapping":http://qt-project.org/wiki/ForumHelp#e3f82045ad0f480d3fb9e0ac2d58fb01 for your code sections nect time. I have introduced them for you.