PDA

View Full Version : How to apply a magnifier with this QGlwidget?



superwave
23rd June 2011, 23:34
I have read the code of Vector Deformation:
http://www.qtcentre.org/attachment.php?attachmentid=6604&d=1308864257

This example magnifies the words in the widget using

path.setElementPositionAt(i,
x + flip * dx * len / m_radius,
y + flip * dy * len / m_radius);

Right now, what I want to do is: magnify the whole content under the magnifer but not just the words:

I have drawn the linkages and nodes using OpenGL in the QGLWidget:
http://www.qtcentre.org/attachment.php?attachmentid=6605&d=1308864651

What I want to do is: magnify the linkages and nodes under the magnifier. However, this seems not as easy as the example Vector Deformation.

So, I want to get some suggestions from you.

Thanks a lot.

Dong Back Kim
5th August 2011, 08:04
I have read the code of Vector Deformation:
http://www.qtcentre.org/attachment.php?attachmentid=6604&d=1308864257

This example magnifies the words in the widget using

path.setElementPositionAt(i,
x + flip * dx * len / m_radius,
y + flip * dy * len / m_radius);

Right now, what I want to do is: magnify the whole content under the magnifer but not just the words:

I have drawn the linkages and nodes using OpenGL in the QGLWidget:
http://www.qtcentre.org/attachment.php?attachmentid=6605&d=1308864651

What I want to do is: magnify the linkages and nodes under the magnifier. However, this seems not as easy as the example Vector Deformation.

So, I want to get some suggestions from you.

Thanks a lot.

This is really a OpenGL question so my answer is also using OpenGL =) You need to move your eye position around in order to magnify the scene. It means YOU are moving towards to the nodes then it will creates "magnifier" effect.

Since you've drawn those nodes in OpenGL, I guess you know what I am talking about ;)

Regards,
Dong Back Kim