Rotate and move transform
#5
No other transformation!
To be sure i wrote anoter simple code with only a modelmover but nothing! where i'm wrong
Here's the code
Code:
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load

       mygrid.Background = System.Windows.Media.Brushes.White
       mygrid.Children.Add(myview)


       _targetPositionCamera.TargetPosition = New Point3D(0, 30, 0)
       _targetPositionCamera.Distance = 100
       _targetPositionCamera.Heading = 0
       _targetPositionCamera.Attitude = 0
       _targetPositionCamera.ShowCameraLight = ShowCameraLightType.Always
       _targetPositionCamera.TargetViewport3D = myview


       Dim _mouseCameraController = New Ab3d.Controls.MouseCameraController()

       _mouseCameraController.RotateCameraConditions = MouseCameraController.MouseAndKeyboardConditions.RightMouseButtonPressed
       _mouseCameraController.MoveCameraConditions = (MouseCameraController.MouseAndKeyboardConditions.RightMouseButtonPressed Or MouseCameraController.MouseAndKeyboardConditions.ControlKey)
       _mouseCameraController.EventsSourceElement = mygrid
       _mouseCameraController.TargetCamera = _targetPositionCamera


       mygrid.Children.Add(_mouseCameraController)

       mygrid.Children.Add(_targetPositionCamera)


       ElementHost1.Child = mygrid

       AddHandler mymodelmover.ModelMoveStarted, AddressOf startedmove
       AddHandler mymodelmover.ModelMoved, AddressOf rotatedmove

       myview.Children.Add(mymodelmover)

   End Sub
   Sub startedmove(sender As Object, args As EventArgs)


       _offsetx = 0
       _offsety = 0
       _offsetz = 0
       first_move = True
       Dim translatetransform As New TranslateTransform3D(_offsetx, _offsety, _offsetz)
       mymodelmover.Transform = translatetransform

   End Sub
   Sub rotatedmove(sender As Object, args As Ab3d.Common.ModelMovedEventArgs)
       _offsetx = args.MoveVector3D.X
       _offsety = args.MoveVector3D.Y
       _offsetz = args.MoveVector3D.Z

   End Sub
  


Messages In This Thread
Rotate and move transform - by kreativasas - 06-22-2020, 04:32 PM
RE: Rotate and move transform - by abenedik - 06-23-2020, 05:06 PM
RE: Rotate and move transform - by kreativasas - 08-04-2020, 04:25 PM
RE: Rotate and move transform - by abenedik - 08-05-2020, 08:55 AM
RE: Rotate and move transform - by kreativasas - 08-05-2020, 10:40 AM
RE: Rotate and move transform - by abenedik - 08-05-2020, 06:39 PM
RE: Rotate and move transform - by kreativasas - 08-10-2020, 10:37 AM

Forum Jump:


Users browsing this thread:
1 Guest(s)