PDA

View Full Version : Restrict some operations in one viewport in Multiple Viewport operations ??



jerin3D
05-26-2002, 11:13 PM
Hi,

In my application i displayed a 3D object in a window and the axis is displayed in the left bottom corner of the window.For displaying axis,i specified a small viewport before drawinfg the axis and after drawing viewport restored.My problem is if i zoom /translate the object i don't want to zoom/translate the axis.But the rotation of axis is allowed.Now the rotation/translation/zoom is also applied to the small viewport also

How i can achive this ??

Thanx in Advance,

Jerry

Bob
05-26-2002, 11:45 PM
Draw the object as usual, then before you draw the axes, reset the transformations and apply the rotation again.



ActivateViewport(object);
glPushMatrix();
glRotate(...);
glTranslate(...);
glScale(...);
DrawObject();
glPopMatrix();
glPushMatrix();
ActivateViewport(axes);
glRotate(...);
DrawAxes();
glPopMatrix();

The parameters in the second glRotate should be the same as in the first glRotate. This way, the object will be affected by the three transformations, and the axes will only be affected by the rotation.

jerin3D
05-27-2002, 01:59 AM
Thank u Bob.
It is working well ...

Thank u very much for ur reply

Jerry