| 52 |
//rotate and pan object clicked |
//rotate and pan object clicked |
| 53 |
private TranslateTransform3D _clickedTranslate ;//= new TranslateTransform3D(); |
private TranslateTransform3D _clickedTranslate ;//= new TranslateTransform3D(); |
| 54 |
private TranslateTransform3D _clickedTranslateOriginal;// = new TranslateTransform3D(); |
private TranslateTransform3D _clickedTranslateOriginal;// = new TranslateTransform3D(); |
| 55 |
private RotateTransform3D _clickedRotate ;//= new RotateTransform3D(); |
private RotateTransform3D _clickedRotate = new RotateTransform3D(); |
| 56 |
private AxisAngleRotation3D _clickedAxisAngleRotate = new AxisAngleRotation3D(); |
private AxisAngleRotation3D _clickedAxisAngleRotate = new AxisAngleRotation3D(); |
| 57 |
Point3D _clickedCenterPosition; |
Point3D _clickedCenterPosition; |
| 58 |
|
|
| 69 |
//_transform.Children.Add(_translate); |
//_transform.Children.Add(_translate); |
| 70 |
_transform.Children.Add(_rotationTransform); |
_transform.Children.Add(_rotationTransform); |
| 71 |
// _transform.Children.Add(_scale); |
// _transform.Children.Add(_scale); |
|
|
|
|
// _clickedRotate.Rotation = _clickedAxisAngleRotate; |
|
| 72 |
} |
} |
| 73 |
|
|
| 74 |
/// <summary> |
/// <summary> |
| 97 |
_eventSource.MouseUp -= this.OnMouseUp; |
_eventSource.MouseUp -= this.OnMouseUp; |
| 98 |
_eventSource.MouseMove -= this.OnMouseMove; |
_eventSource.MouseMove -= this.OnMouseMove; |
| 99 |
_eventSource.MouseLeftButtonDown -= _eventSource_MouseLeftButtonDown; |
_eventSource.MouseLeftButtonDown -= _eventSource_MouseLeftButtonDown; |
| 100 |
|
_eventSource.MouseRightButtonDown -= _eventSource_MouseRightButtonDown; |
| 101 |
} |
} |
| 102 |
_eventSource = value; |
_eventSource = value; |
| 103 |
_eventSource.MouseWheel += _eventSource_MouseWheel; |
_eventSource.MouseWheel += _eventSource_MouseWheel; |
| 104 |
_eventSource.MouseLeftButtonDown += new MouseButtonEventHandler(_eventSource_MouseLeftButtonDown); |
_eventSource.MouseLeftButtonDown += _eventSource_MouseLeftButtonDown; |
| 105 |
|
_eventSource.MouseRightButtonDown += _eventSource_MouseRightButtonDown; |
| 106 |
_eventSource.MouseUp += this.OnMouseUp; |
_eventSource.MouseUp += this.OnMouseUp; |
| 107 |
_eventSource.MouseMove += this.OnMouseMove; |
_eventSource.MouseMove += this.OnMouseMove; |
| 108 |
|
|
| 109 |
} |
} |
| 110 |
} |
} |
| 111 |
|
|
| 112 |
void _eventSource_MouseWheel(object sender, MouseWheelEventArgs e) |
void _eventSource_MouseRightButtonDown(object sender, MouseButtonEventArgs e) |
| 113 |
{ |
{ |
| 114 |
double scale = e.Delta / 1200.00; |
Mouse.Capture(EventSource, CaptureMode.Element); |
|
double distance = Point3D.Subtract(_cameraLookPoint, _camera.Position).Length; |
|
| 115 |
|
|
| 116 |
if (distance > 1024 || distance <= 10) |
Point pclick = e.GetPosition(EventSource); |
| 117 |
|
HitTestResult hitresult = VisualTreeHelper.HitTest(EventSource, pclick); |
| 118 |
|
RayMeshGeometry3DHitTestResult result3d = hitresult as RayMeshGeometry3DHitTestResult; |
| 119 |
|
if (result3d == null) |
| 120 |
|
return; |
| 121 |
|
|
| 122 |
|
visul3d = result3d.VisualHit as ModelVisual3D; |
| 123 |
|
if (visul3d == null) |
| 124 |
|
return; |
| 125 |
|
|
| 126 |
|
Transform3DGroup group = visul3d.Transform as Transform3DGroup; |
| 127 |
|
if (group != null) |
| 128 |
{ |
{ |
| 129 |
if (touch == false) |
foreach (Transform3D tran in group.Children) |
| 130 |
{ |
{ |
| 131 |
touch = true; |
if (tran is RotateTransform3D) |
| 132 |
|
{ |
| 133 |
|
_clickedRotate = new RotateTransform3D(); |
| 134 |
|
_clickedRotate = tran as RotateTransform3D; |
| 135 |
|
if (_clickedRotate != null) |
| 136 |
|
{ |
| 137 |
|
_clickedAxisAngleRotate = new AxisAngleRotation3D(); |
| 138 |
|
_clickedRotate.Rotation = _clickedAxisAngleRotate; |
| 139 |
} |
} |
| 140 |
} |
} |
| 141 |
else |
else if (tran is TranslateTransform3D) |
| 142 |
{ |
_clickedTranslate = tran as TranslateTransform3D; |
| 143 |
touch = false; |
} |
| 144 |
} |
} |
| 145 |
|
else |
| 146 |
|
return; |
| 147 |
|
//for pan the object |
| 148 |
|
_clickedTranslateOriginal = _clickedTranslate.Clone(); |
| 149 |
|
|
| 150 |
if (touch == true) |
//for ALT + MOUSE + ROTATE |
| 151 |
scale = -scale; |
Petzold.Media3D.LineRange line; |
| 152 |
_camera.Position = new Point3D(_camera.Position.X + scale * _cameraLookDirection.X, |
Petzold.Media3D.ViewportInfo.Point2DtoPoint3D(_eventSource as Viewport3D, pclick, out line); |
| 153 |
_camera.Position.Y + scale * _cameraLookDirection.Y, |
_cameraLookPoint = line.PointFromY(visul3d.Content.Bounds.Y); |
| 154 |
_camera.Position.Z + scale * _cameraLookDirection.Z); |
|
| 155 |
_camera.LookDirection = Point3D.Subtract(_cameraLookPoint, _camera.Position); |
_rotationTransform.CenterX = _cameraLookPoint.X; |
| 156 |
|
_rotationTransform.CenterY = _cameraLookPoint.Y; |
| 157 |
|
_rotationTransform.CenterZ = _cameraLookPoint.Z; |
| 158 |
|
|
| 159 |
|
//for rotate the object mouse clicked |
| 160 |
|
|
| 161 |
|
_cameraLookDirection = Point3D.Subtract(_cameraLookPoint, _camera.Position); |
| 162 |
|
_camera.LookDirection = _cameraLookDirection; |
| 163 |
|
|
| 164 |
|
isTracking = true; |
| 165 |
|
_eventSource.CaptureMouse(); |
| 166 |
|
_eventSource.Focus(); |
| 167 |
|
e.Handled = true; |
| 168 |
} |
} |
| 169 |
|
|
| 170 |
|
|
| 171 |
void _eventSource_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) |
void _eventSource_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) |
| 172 |
{ |
{ |
| 173 |
Mouse.Capture(EventSource, CaptureMode.Element); |
Mouse.Capture(EventSource, CaptureMode.Element); |
| 190 |
if (tran is RotateTransform3D) |
if (tran is RotateTransform3D) |
| 191 |
{ |
{ |
| 192 |
_clickedRotate = new RotateTransform3D(); |
_clickedRotate = new RotateTransform3D(); |
| 193 |
_clickedRotate = group.Children[0] as RotateTransform3D; |
_clickedRotate = tran as RotateTransform3D ; |
| 194 |
if (_clickedRotate != null) |
if (_clickedRotate != null) |
| 195 |
{ |
{ |
| 196 |
_clickedAxisAngleRotate = new AxisAngleRotation3D(); |
_clickedAxisAngleRotate = new AxisAngleRotation3D(); |
| 198 |
} |
} |
| 199 |
} |
} |
| 200 |
else if (tran is TranslateTransform3D) |
else if (tran is TranslateTransform3D) |
| 201 |
_clickedTranslate = group.Children[1] as TranslateTransform3D; |
{ |
| 202 |
|
//_clickedTranslate = new TranslateTransform3D(); |
| 203 |
|
_clickedTranslate =(TranslateTransform3D)tran ; |
| 204 |
|
} |
| 205 |
} |
} |
| 206 |
} |
} |
| 207 |
else |
else |
| 208 |
return; |
return; |
| 209 |
|
|
|
|
|
| 210 |
//for pan the object |
//for pan the object |
|
//clickedVisual = visul3d; |
|
|
//visul3d.Transform = group; |
|
| 211 |
_clickedTranslateOriginal = _clickedTranslate.Clone(); |
_clickedTranslateOriginal = _clickedTranslate.Clone(); |
| 212 |
|
|
|
|
|
| 213 |
//for ALT + MOUSE + ROTATE |
//for ALT + MOUSE + ROTATE |
| 214 |
Petzold.Media3D.LineRange line; |
Petzold.Media3D.LineRange line; |
| 215 |
Petzold.Media3D.ViewportInfo.Point2DtoPoint3D(_eventSource as Viewport3D, pclick, out line); |
Petzold.Media3D.ViewportInfo.Point2DtoPoint3D(_eventSource as Viewport3D, pclick, out line); |
| 220 |
_rotationTransform.CenterZ = _cameraLookPoint.Z; |
_rotationTransform.CenterZ = _cameraLookPoint.Z; |
| 221 |
|
|
| 222 |
//for rotate the object mouse clicked |
//for rotate the object mouse clicked |
|
|
|
| 223 |
_clickedRotate.CenterX = _clickedCenterPosition.X = visul3d.Content.Bounds.Location.X + visul3d.Content.Bounds.SizeX / 2; |
_clickedRotate.CenterX = _clickedCenterPosition.X = visul3d.Content.Bounds.Location.X + visul3d.Content.Bounds.SizeX / 2; |
| 224 |
_clickedRotate.CenterY = _clickedCenterPosition.Y = visul3d.Content.Bounds.Location.Y + visul3d.Content.Bounds.SizeY / 2; |
_clickedRotate.CenterY = _clickedCenterPosition.Y = visul3d.Content.Bounds.Location.Y + visul3d.Content.Bounds.SizeY / 2; |
| 225 |
_clickedRotate.CenterZ = _clickedCenterPosition.Z = visul3d.Content.Bounds.Location.Z + visul3d.Content.Bounds.SizeZ / 2; |
_clickedRotate.CenterZ = _clickedCenterPosition.Z = visul3d.Content.Bounds.Location.Z + visul3d.Content.Bounds.SizeZ / 2; |
| 244 |
Mouse.Capture(EventSource, CaptureMode.None); |
Mouse.Capture(EventSource, CaptureMode.None); |
| 245 |
isTracking = false; |
isTracking = false; |
| 246 |
|
|
|
//Transform3DGroup clickedtransformGroup = new Transform3DGroup(); |
|
|
//clickedtransformGroup.Children.Add(_clickedRotate); |
|
|
//clickedtransformGroup.Children.Add(_clickedTranslate); |
|
|
|
|
|
//visul3d.Transform = clickedtransformGroup; |
|
|
|
|
|
_clickedTranslate = null; |
|
|
|
|
| 247 |
_eventSource.ReleaseMouseCapture(); |
_eventSource.ReleaseMouseCapture(); |
| 248 |
_eventSource.Cursor = Cursors.Arrow; |
_eventSource.Cursor = Cursors.Arrow; |
| 249 |
} |
} |
| 266 |
} |
} |
| 267 |
else if (e.RightButton == MouseButtonState.Pressed && Keyboard.IsKeyDown(Key.Q)) |
else if (e.RightButton == MouseButtonState.Pressed && Keyboard.IsKeyDown(Key.Q)) |
| 268 |
{ |
{ |
| 269 |
|
if(isTracking) |
| 270 |
CameraPanUP(currentPosition); |
CameraPanUP(currentPosition); |
| 271 |
} |
} |
| 272 |
else if (e.RightButton == MouseButtonState.Pressed && Keyboard.IsKeyDown(Key.A)) |
else if (e.RightButton == MouseButtonState.Pressed && Keyboard.IsKeyDown(Key.A)) |
| 273 |
{ |
{ |
| 274 |
//TODO: |
//TODO: |
| 275 |
CameraPanLeft(currentPosition); |
if (isTracking) |
| 276 |
|
{ |
| 277 |
|
_eventSource.Cursor = Cursors.None; |
| 278 |
|
CameraPanLeftRight(currentPosition); |
| 279 |
|
} |
| 280 |
} |
} |
| 281 |
else if (e.LeftButton == MouseButtonState.Pressed && (Keyboard.IsKeyDown(Key.LeftCtrl) || Keyboard.IsKeyDown(Key.RightCtrl)) |
else if (e.LeftButton == MouseButtonState.Pressed && (Keyboard.IsKeyDown(Key.LeftCtrl) || Keyboard.IsKeyDown(Key.RightCtrl)) |
| 282 |
&& (Keyboard.IsKeyDown(Key.LeftShift) || Keyboard.IsKeyDown(Key.RightShift))) |
&& (Keyboard.IsKeyDown(Key.LeftShift) || Keyboard.IsKeyDown(Key.RightShift))) |
| 295 |
PanObject(currentPosition); |
PanObject(currentPosition); |
| 296 |
} |
} |
| 297 |
} |
} |
| 298 |
|
else if (e.LeftButton == MouseButtonState.Pressed) |
| 299 |
|
{ |
| 300 |
|
LookAround(currentPosition); |
| 301 |
|
} |
| 302 |
|
|
| 303 |
_previousPosition2D = currentPosition; |
_previousPosition2D = currentPosition; |
| 304 |
} |
} |
| 305 |
|
|
| 306 |
private void RotateObject(Point currentPosition) |
private void LookAround(Point currentPosition) |
| 307 |
{ |
{ |
| 308 |
Vector3D currentPosition3D = ProjectToTrackball(EventSource.ActualWidth, EventSource.ActualHeight, currentPosition); |
Vector3D currentPosition3D = ProjectToTrackball(EventSource.ActualWidth, EventSource.ActualHeight, currentPosition); |
| 309 |
|
|
| 310 |
Vector3D axis = Vector3D.CrossProduct(_previousPosition3D, currentPosition3D); |
Vector3D axis = Vector3D.CrossProduct(_previousPosition3D, currentPosition3D); |
| 311 |
double angle = Vector3D.AngleBetween(_previousPosition3D, currentPosition3D); |
double angle = Vector3D.AngleBetween(_previousPosition3D, currentPosition3D); |
| 312 |
|
|
| 313 |
|
// We negate the angle because we are rotating the camera. |
| 314 |
|
// Do not do this if you are rotating the scene instead. |
| 315 |
Quaternion delta = new Quaternion(axis, -angle); |
Quaternion delta = new Quaternion(axis, -angle); |
| 316 |
|
|
| 317 |
// Get the current orientantion from the RotateTransform3D |
// Get the current orientantion from the RotateTransform3D |
| 318 |
Quaternion q = new Quaternion(_clickedAxisAngleRotate.Axis, _clickedAxisAngleRotate.Angle); |
Transform3DGroup group = _camera.Transform as Transform3DGroup; |
| 319 |
|
if (group == null) |
| 320 |
|
return; |
| 321 |
|
|
| 322 |
|
foreach (RotateTransform3D rotate in group.Children) |
| 323 |
|
{ |
| 324 |
|
RotateTransform3D rt = (RotateTransform3D)rotate; |
| 325 |
|
AxisAngleRotation3D r = (AxisAngleRotation3D)rt.Rotation; |
| 326 |
|
Quaternion q = new Quaternion(r.Axis, r.Angle); |
| 327 |
|
|
| 328 |
// Compose the delta with the previous orientation |
// Compose the delta with the previous orientation |
| 329 |
q *= delta; |
q *= delta; |
| 330 |
|
|
| 331 |
// Write the new orientation back to the Rotation3D |
// Write the new orientation back to the Rotation3D |
| 332 |
|
r.Axis = q.Axis; |
| 333 |
|
r.Angle = q.Angle; |
| 334 |
|
} |
| 335 |
|
|
| 336 |
|
_previousPosition3D = currentPosition3D; |
| 337 |
|
} |
| 338 |
|
|
| 339 |
|
void _eventSource_MouseWheel(object sender, MouseWheelEventArgs e) |
| 340 |
|
{ |
| 341 |
|
double scale = e.Delta / 1200.00; |
| 342 |
|
double distance = Point3D.Subtract(_cameraLookPoint, _camera.Position).Length; |
| 343 |
|
|
| 344 |
if (_clickedAxisAngleRotate.Angle >= 360||_clickedAxisAngleRotate.Angle<=-360) |
if (distance > 1024 || distance <= 10) |
| 345 |
_clickedAxisAngleRotate.Angle = 0; |
{ |
| 346 |
|
if (touch == false) |
| 347 |
|
{ |
| 348 |
|
touch = true; |
| 349 |
|
} |
| 350 |
|
} |
| 351 |
|
else |
| 352 |
|
{ |
| 353 |
|
touch = false; |
| 354 |
|
} |
| 355 |
|
|
| 356 |
|
if (touch == true) |
| 357 |
|
scale = -scale; |
| 358 |
|
_camera.Position = new Point3D(_camera.Position.X + scale * _cameraLookDirection.X, |
| 359 |
|
_camera.Position.Y + scale * _cameraLookDirection.Y, |
| 360 |
|
_camera.Position.Z + scale * _cameraLookDirection.Z); |
| 361 |
|
_camera.LookDirection = Point3D.Subtract(_cameraLookPoint, _camera.Position); |
| 362 |
|
} |
| 363 |
|
|
| 364 |
_clickedAxisAngleRotate.Axis = q.Axis; |
private void RotateObject(Point currentPosition) |
| 365 |
_clickedAxisAngleRotate.Angle -= q.Angle; |
{ |
| 366 |
|
Vector3D currentPosition3D = ProjectToTrackball(EventSource.ActualWidth, EventSource.ActualHeight, currentPosition); |
| 367 |
|
|
| 368 |
|
Vector3D axis = Vector3D.CrossProduct(_previousPosition3D, currentPosition3D); |
| 369 |
|
double angle = Vector3D.AngleBetween(_previousPosition3D, currentPosition3D); |
| 370 |
|
|
| 371 |
|
//if (_clickedAxisAngleRotate.Angle >= 360||_clickedAxisAngleRotate.Angle<=-360) |
| 372 |
|
// _clickedAxisAngleRotate.Angle = 0; |
| 373 |
|
|
| 374 |
|
_clickedAxisAngleRotate.Axis = axis; |
| 375 |
|
_clickedAxisAngleRotate.Angle -= angle; |
| 376 |
|
|
| 377 |
_previousPosition3D = currentPosition3D; |
_previousPosition3D = currentPosition3D; |
| 378 |
|
|
| 379 |
} |
} |
| 380 |
|
|
| 381 |
private Vector3D ProjectToTrackball(double width, double height, Point point) |
private Vector3D ProjectToTrackball(double width, double height, Point point) |
| 389 |
double z2 = 1 - x * x - y * y; // z^2 = 1 - x^2 - y^2 |
double z2 = 1 - x * x - y * y; // z^2 = 1 - x^2 - y^2 |
| 390 |
double z = z2 > 0 ? Math.Sqrt(z2) : 0; |
double z = z2 > 0 ? Math.Sqrt(z2) : 0; |
| 391 |
|
|
| 392 |
return new Vector3D(x, y, z); |
Vector3D v = new Vector3D(x, z, y); |
| 393 |
|
//v.Normalize(); |
| 394 |
|
return v; |
| 395 |
} |
} |
| 396 |
|
|
| 397 |
#endregion Event Handling |
#endregion Event Handling |
| 398 |
|
|
| 399 |
|
|
| 400 |
private void CameraPanLeft(Point currentPosition) |
private void CameraPanLeftRight(Point currentPosition) |
| 401 |
{ |
{ |
| 402 |
LineRange range; |
double scalex = currentPosition.X - _previousPosition2D.X; |
| 403 |
ViewportInfo.Point2DtoPoint3D(_eventSource as Viewport3D, currentPosition, out range); |
|
| 404 |
Point3D pointNew = range.PointFromY(_clickedCenterPosition.Y); |
Vector3D vector3D = GetTranslationVector3D(visul3d, _previousPosition2D, currentPosition); |
| 405 |
|
|
| 406 |
//_camera.Position. |
_camera.Position += Math.Abs(scalex) * vector3D; |
| 407 |
} |
} |
| 408 |
|
|
| 409 |
private void PanObject(Point currentPosition) |
private void PanObject(Point currentPosition) |
| 410 |
{ |
{ |
| 411 |
double scaley = currentPosition.Y - _previousPosition2D.Y; |
double scaley = currentPosition.Y - _previousPosition2D.Y; |
| 412 |
scaley = scaley / 100.00; |
scaley = Math.Abs( scaley / 1.00); |
| 413 |
|
|
| 414 |
|
|
| 415 |
double scalex = currentPosition.X - _previousPosition2D.X; |
double scalex = currentPosition.X - _previousPosition2D.X; |
| 416 |
scalex = scalex / 100.00; |
scalex = Math.Abs( scalex / 1.00); |
| 417 |
|
|
| 418 |
Vector3D vector3D = GetTranslationVector3D(visul3d, _previousPosition2D, currentPosition); |
Vector3D vector3D = GetTranslationVector3D(visul3d, _previousPosition2D, currentPosition); |
|
// Matrix3D matrix3D = visul3d.Transform.Value;// modelHit.Transform.Value; |
|
|
// vector3D += new Vector3D(matrix3D.OffsetX, matrix3D.OffsetY, matrix3D.OffsetZ); |
|
| 419 |
|
|
| 420 |
_clickedTranslate.OffsetX += vector3D.X*1.5;// _clickedTranslateOriginal.OffsetX + vector3D.X; |
_clickedTranslate.OffsetX += scalex * vector3D.X;// _clickedTranslateOriginal.OffsetX + vector3D.X; |
| 421 |
_clickedTranslate.OffsetY += vector3D.Y*1.5;// _clickedTranslateOriginal.OffsetY + vector3D.Y; |
_clickedTranslate.OffsetY += scalex * vector3D.Y;// _clickedTranslateOriginal.OffsetY + vector3D.Y; |
| 422 |
_clickedTranslate.OffsetZ += vector3D.Z*1.5;// _clickedTranslateOriginal.OffsetZ + vector3D.Z;// vectMouse.Z; |
_clickedTranslate.OffsetZ += scaley * vector3D.Z;// _clickedTranslateOriginal.OffsetZ + vector3D.Z;// vectMouse.Z; |
|
|
|
|
|
|
|
//double scalez = Math.Sqrt(scalex * scalex + scaley * scaley); |
|
|
/* |
|
|
LineRange range; |
|
|
ViewportInfo.Point2DtoPoint3D(_eventSource as Viewport3D, currentPosition, out range); |
|
|
Point3D pointNew = range.PointFromY(_clickedCenterPosition.Y+scaley*_clickedCenterPosition.Y); |
|
|
|
|
|
Vector3D vectMouse = pointNew - _cameraLookPoint; |
|
|
//vectMouse = Vector3D.Multiply(_cameraLookDirection, visul3d.Transform.Value); |
|
|
_clickedTranslate.OffsetX = _clickedTranslateOriginal.OffsetX + vectMouse.X; |
|
|
_clickedTranslate.OffsetY = _clickedTranslateOriginal.OffsetY + vectMouse.Y; |
|
|
_clickedTranslate.OffsetZ = _clickedTranslateOriginal.OffsetZ + vectMouse.Z;// vectMouse.Z; |
|
|
|
|
|
// //vectMouse = Vector3D.Multiply(_cameraLookDirection, visul3d.Transform.Value); |
|
|
//_clickedTranslate.OffsetX += scalex * vectMouse.X;// _clickedTranslateOriginal.OffsetX + vectMouse.X; |
|
|
// _clickedTranslate.OffsetY += scaley * vectMouse.Y;// _clickedTranslateOriginal.OffsetY + vectMouse.Y; |
|
|
// //_clickedTranslate.OffsetZ += scaley * vectMouse.Z;// _clickedTranslateOriginal.OffsetZ + vectMouse.Z;// vectMouse.Z; |
|
|
*/ |
|
|
|
|
|
// matrix3D.OffsetX = vector3D.X; |
|
|
// matrix3D.OffsetY = vector3D.Y; |
|
|
// matrix3D.OffsetZ = vector3D.Z; |
|
|
//visul3d.Transform = new MatrixTransform3D(matrix3D); |
|
| 423 |
|
|
| 424 |
//mm += vectMouse.Y.ToString() + "/n"; |
visul3d.Transform.Transform(new Point3D(visul3d.Content.Bounds.Location.X + scalex * vector3D.X, visul3d.Content.Bounds.Location.Y + scalex * vector3D.Y, visul3d.Content.Bounds.Location.Z + scaley * vector3D.Z)); |
| 425 |
|
|
| 426 |
} |
} |
| 427 |
|
|
| 454 |
_camera.LookDirection = new Vector3D(_camera.LookDirection.X, _camera.LookDirection.Y, _camera.LookDirection.Z + scale); |
_camera.LookDirection = new Vector3D(_camera.LookDirection.X, _camera.LookDirection.Y, _camera.LookDirection.Z + scale); |
| 455 |
} |
} |
| 456 |
|
|
|
string mm = ""; |
|
| 457 |
bool touch = false; |
bool touch = false; |
| 458 |
private void Focus(Point currentPosition) |
private void Focus(Point currentPosition) |
| 459 |
{ |
{ |