[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Moss-devel] CVS: moss/3Dsia/client/3Dcf/src World.cxx,1.7,1.8
From: |
Felix Morgner <address@hidden> |
Subject: |
[Moss-devel] CVS: moss/3Dsia/client/3Dcf/src World.cxx,1.7,1.8 |
Date: |
Sun, 02 Feb 2003 15:03:49 -0500 |
Update of /cvsroot/moss/moss/3Dsia/client/3Dcf/src
In directory subversions:/tmp/cvs-serv30903
Modified Files:
World.cxx
Log Message:
Zooming doesn't work
Index: World.cxx
===================================================================
RCS file: /cvsroot/moss/moss/3Dsia/client/3Dcf/src/World.cxx,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** World.cxx 2 Feb 2003 16:11:13 -0000 1.7
--- World.cxx 2 Feb 2003 20:03:47 -0000 1.8
***************
*** 53,56 ****
--- 53,57 ----
m_dYrot = .0;
m_dZrot = .0;
+ m_dZoom = 6.0;
m_nWidth = 640;
m_nHeight = 480;
***************
*** 112,116 ****
glLoadIdentity();
gluPerspective(45.f, (GLfloat)nWidth/(GLfloat)nHeight, .1f, 100.f);
! gluLookAt(2, 2, 6, 0, 0, 0, 0, 1, 0);
glMatrixMode(GL_MODELVIEW);
} // void CWorld::InitGL(int nWidth, int nHeight)
--- 113,117 ----
glLoadIdentity();
gluPerspective(45.f, (GLfloat)nWidth/(GLfloat)nHeight, .1f, 100.f);
! gluLookAt(2, 2, m_dZoom, 0, 0, 0, 0, 1, 0);
glMatrixMode(GL_MODELVIEW);
} // void CWorld::InitGL(int nWidth, int nHeight)
***************
*** 269,280 ****
if(nButton == GLUT_LEFT_BUTTON && nStatus == GLUT_DOWN)
{
! nFirst = 1;
glutSetCursor(GLUT_CURSOR_CYCLE);
! nMouseX = x;
! nMouseY = y;
}
else if(nButton == GLUT_LEFT_BUTTON && nStatus == GLUT_UP)
{
glutSetCursor(GLUT_CURSOR_INHERIT);
}
--- 270,282 ----
if(nButton == GLUT_LEFT_BUTTON && nStatus == GLUT_DOWN)
{
! m_nFirst = 1;
glutSetCursor(GLUT_CURSOR_CYCLE);
! m_dMouseX = x;
! m_dMouseY = y;
}
else if(nButton == GLUT_LEFT_BUTTON && nStatus == GLUT_UP)
{
glutSetCursor(GLUT_CURSOR_INHERIT);
+ m_nFirst = 0;
}
***************
*** 282,306 ****
{
glutSetCursor(GLUT_CURSOR_UP_DOWN);
! nZooming = 1;
! nMouseZ = y - 3 * 9;
}
else if(nButton == GLUT_MIDDLE_BUTTON && nStatus == GLUT_UP)
{
glutSetCursor(GLUT_CURSOR_INHERIT);
}
/* else if(nButton == 0 && nStatus == 1)
{
! nDragging = 0;
glutSetCursor(GLUT_CURSOR_INHERIT);
}
if(nButton == 1 && nStatus == 0)
{
! nFirst = nZooming = 1;
glutSetCursor(GLUT_CURSOR_UP_DOWN);
}
else if(nButton == 1 && nStatus == 1)
{
! nZooming = 0;
glutSetCursor(GLUT_CURSOR_INHERIT);
}
--- 284,309 ----
{
glutSetCursor(GLUT_CURSOR_UP_DOWN);
! m_nZooming = 1;
! m_dMouseZ = y - 3 * 9;
}
else if(nButton == GLUT_MIDDLE_BUTTON && nStatus == GLUT_UP)
{
glutSetCursor(GLUT_CURSOR_INHERIT);
+ m_nZooming = 0;
}
/* else if(nButton == 0 && nStatus == 1)
{
! m_nDragging = 0;
glutSetCursor(GLUT_CURSOR_INHERIT);
}
if(nButton == 1 && nStatus == 0)
{
! m_nFirst = m_nZooming = 1;
glutSetCursor(GLUT_CURSOR_UP_DOWN);
}
else if(nButton == 1 && nStatus == 1)
{
! m_nZooming = 0;
glutSetCursor(GLUT_CURSOR_INHERIT);
}
***************
*** 312,335 ****
void CWorld::MouseMotion(int x, int y)
{
! if(nFirst == 1)
{
! m_dXrot = m_dXrot - (y - nMouseY);
! m_dYrot = m_dYrot - (x - nMouseX);
! nMouseX = x;
! nMouseY = y;
glutPostRedisplay();
}
! if(nZooming == 1)
{
! glMatrixMode(GL_PROJECTION);
! glLoadIdentity();
! gluPerspective(45.f, (GLfloat)m_nWidth/(GLfloat)m_nHeight, .1f, 100.f);
! gluLookAt(2, 2, nMouseZ/6, 0, 0, 0, 0, 1, 0);
! glMatrixMode(GL_MODELVIEW);
!
glutPostRedisplay();
}
} // void CWorld::MouseMotion(int x, int y)
--- 315,337 ----
void CWorld::MouseMotion(int x, int y)
{
!
! if(m_nFirst == 1)
{
! m_dXrot = m_dXrot - (y - m_dMouseY);
! m_dYrot = m_dYrot - (x - m_dMouseX);
! m_dMouseX = x;
! m_dMouseY = y;
glutPostRedisplay();
+
}
! if(m_nZooming == 1)
{
! // m_dMouseZ = (y - m_dMouseY) / 3.0;
! m_dZoom = m_dMouseZ;
glutPostRedisplay();
+
}
} // void CWorld::MouseMotion(int x, int y)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Moss-devel] CVS: moss/3Dsia/client/3Dcf/src World.cxx,1.7,1.8,
Felix Morgner <address@hidden> <=