Added Jonas Diemer's patch (3D display: enhanced movings from mouse and tools)

This commit is contained in:
CHARRAS 2008-03-03 08:00:26 +00:00
parent 56ef4d3b44
commit 7c482f68b3
3 changed files with 705 additions and 651 deletions

View File

@ -283,14 +283,25 @@ void Pcb3D_GLCanvas::OnMouseEvent( wxMouseEvent& event )
if( event.Dragging() ) if( event.Dragging() )
{ {
/* drag in progress, simulate trackball */ if( event.LeftIsDown() )
trackball( spin_quat, {
(2.0 * g_Parm_3D_Visu.m_Beginx - size.x) / size.x, /* drag in progress, simulate trackball */
(size.y - 2.0 * g_Parm_3D_Visu.m_Beginy) / size.y, trackball( spin_quat,
( 2.0 * event.GetX() - size.x) / size.x, (2.0 * g_Parm_3D_Visu.m_Beginx - size.x) / size.x,
( size.y - 2.0 * event.GetY() ) / size.y ); (size.y - 2.0 * g_Parm_3D_Visu.m_Beginy) / size.y,
( 2.0 * event.GetX() - size.x) / size.x,
( size.y - 2.0 * event.GetY() ) / size.y );
add_quats( spin_quat, g_Parm_3D_Visu.m_Quat, g_Parm_3D_Visu.m_Quat ); add_quats( spin_quat, g_Parm_3D_Visu.m_Quat, g_Parm_3D_Visu.m_Quat );
}
else if( event.MiddleIsDown() )
{
/* middle button drag -> pan */
/* Current zoom and an additional factor are taken into account for the amount of panning. */
const float PAN_FACTOR = 8.0 * g_Parm_3D_Visu.m_Zoom;
g_Draw3d_dx -= PAN_FACTOR * ( g_Parm_3D_Visu.m_Beginx - event.GetX() ) / size.x;
g_Draw3d_dy -= PAN_FACTOR * (event.GetY() - g_Parm_3D_Visu.m_Beginy) / size.y;
}
/* orientation has changed, redraw mesh */ /* orientation has changed, redraw mesh */
DisplayStatus(); DisplayStatus();

File diff suppressed because it is too large Load Diff

View File

@ -5,6 +5,12 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with Please add newer entries at the top, list the date and your name with
email address. email address.
2008-mars-03 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
3d display:
Added Jonas Diemer's patch (enhanced movings from mouse and tools)
2008-Mar-1 UPDATE Dick Hollenbeck <dick@softplc.com> 2008-Mar-1 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================ ================================================================================
+pcbnew +pcbnew