Oops, forgot to consider scale (pixels/mm) for translation from
six-DOF mouse. [git-p4: depot-paths = "//depot/solvespace/": change = 2022]
This commit is contained in:
parent
806c3d8cde
commit
36182448ce
12
draw.cpp
12
draw.cpp
@ -294,9 +294,9 @@ void GraphicsWindow::SpaceNavigatorMoved(double tx, double ty, double tz,
|
|||||||
// Apply the transformation to an imported part. Gain down the Z
|
// Apply the transformation to an imported part. Gain down the Z
|
||||||
// axis, since it's hard to see what you're doing on that one since
|
// axis, since it's hard to see what you're doing on that one since
|
||||||
// it's normal to the screen.
|
// it's normal to the screen.
|
||||||
Vector t = projRight.ScaledBy(tx).Plus(
|
Vector t = projRight.ScaledBy(tx/scale).Plus(
|
||||||
projUp .ScaledBy(ty).Plus(
|
projUp .ScaledBy(ty/scale).Plus(
|
||||||
out .ScaledBy(0.1*tz)));
|
out .ScaledBy(0.1*tz/scale)));
|
||||||
Quaternion q = Quaternion::From(aa, aam);
|
Quaternion q = Quaternion::From(aa, aam);
|
||||||
|
|
||||||
// If we go five seconds without SpaceNavigator input, or if we've
|
// If we go five seconds without SpaceNavigator input, or if we've
|
||||||
@ -320,9 +320,9 @@ void GraphicsWindow::SpaceNavigatorMoved(double tx, double ty, double tz,
|
|||||||
// x and y components are translation; but z component is scale,
|
// x and y components are translation; but z component is scale,
|
||||||
// not translation, or else it would do nothing in a parallel
|
// not translation, or else it would do nothing in a parallel
|
||||||
// projection
|
// projection
|
||||||
offset = offset.Plus(projRight.ScaledBy(tx));
|
offset = offset.Plus(projRight.ScaledBy(tx/scale));
|
||||||
offset = offset.Plus(projUp.ScaledBy(ty));
|
offset = offset.Plus(projUp.ScaledBy(ty/scale));
|
||||||
scale *= exp(0.01*tz);
|
scale *= exp(0.001*tz);
|
||||||
|
|
||||||
if(aam != 0.0) {
|
if(aam != 0.0) {
|
||||||
projRight = projRight.RotatedAbout(aa, -aam);
|
projRight = projRight.RotatedAbout(aa, -aam);
|
||||||
|
@ -1064,9 +1064,9 @@ static BOOL ProcessSpaceNavigatorMsg(MSG *msg) {
|
|||||||
if(sse.type == SI_MOTION_EVENT) {
|
if(sse.type == SI_MOTION_EVENT) {
|
||||||
// The Z axis translation and rotation are both
|
// The Z axis translation and rotation are both
|
||||||
// backwards in the default mapping.
|
// backwards in the default mapping.
|
||||||
double tx = sse.u.spwData.mData[SI_TX]*0.1,
|
double tx = sse.u.spwData.mData[SI_TX]*1.0,
|
||||||
ty = sse.u.spwData.mData[SI_TY]*0.1,
|
ty = sse.u.spwData.mData[SI_TY]*1.0,
|
||||||
tz = -sse.u.spwData.mData[SI_TZ]*0.1,
|
tz = -sse.u.spwData.mData[SI_TZ]*1.0,
|
||||||
rx = sse.u.spwData.mData[SI_RX]*0.001,
|
rx = sse.u.spwData.mData[SI_RX]*0.001,
|
||||||
ry = sse.u.spwData.mData[SI_RY]*0.001,
|
ry = sse.u.spwData.mData[SI_RY]*0.001,
|
||||||
rz = -sse.u.spwData.mData[SI_RZ]*0.001;
|
rz = -sse.u.spwData.mData[SI_RZ]*0.001;
|
||||||
|
Loading…
Reference in New Issue
Block a user