PDA

View Full Version : pan has rotational effect



AeroSujan
10-09-2011, 07:10 AM
Dear Friends
I am doing pan on my 3D model. its panning but also its rotating.
I am using perspective projection. and for panning I am doing like this in
mouse move

int dx = oldP.x - newP.x;
int dy = newP.y - oldP.y;

case PAN:
{
trans[0] -= dx;
trans[1] -= dy;
Invalidate();
}
break;
Just this much....
In OnLButtonDown I am capturing the mouse event and putting oldP = point
then newP is coming in mousemove...
Can u tell me what am I doing wrong why its rotating also....
Any help would be highly appreciated. Thanks Sujan

BionicBytes
10-09-2011, 11:31 AM
Are we supposed to know what "trans" is and how you are using it? Yes we could guess it's a translation matrix - but why should we have to.
You are having a problem with rendering yet you dont post that code.
Think a bit more about your posts and in turn perhaps you'll solve your own issues.