c# - Having problems with RotateTransform3D -


I am creating a program in which, I am trying to implement several changes on ModelVisual3D. I have no problem with Transform 3D translation, but when I try to rotate an object (Model Visual 3D), its Center X, Center Y and Center Z coordinates are going to 0,0,0 There is no indication of how to remember the last position of the object and when I rotate it, the object will be there where I translated it. I applied an object to rotate when the left mouse button is double clicked, but the rotation is only executing once. Here's the peace of the code, which corresponds to the RotateTransform:

  MyViewport.MouseMove + = (Sender, E) => {If (modelHit! = Null & amp; e.LeftButton == MouseButtonState.Pressed) {point endPosition = E. GetPosition (gridDesigner); Vector 3D Vector 3D = GET Transensation Vector 3D (Model Hits, Startups, Endpositions); Matrix 3D Matrix 3D = Model HT. Transcons Value; Vector 3D + = New Vector 3D (Matrix 3D Offset, Matrix 3D Offset, Matrix 3D Offset); Matrix 3D Offset x = Vector 3D X; Matrix 3D Offset Y = 0.2f; Matrix 3D Offset = Vector 3D Zed; ModelHit.Transform = New Matrix Transform 3D (Matrix 3D); Initial position = end position; MyViewport.MouseLeftButtonDown + = (Sender, M) => {If (modelHit! = Null & amp; amp; amp; amp; amp; amp; amp; ;; MLF Button == MouseButtonState.Pressed) {RotateTransform3D RotateTransform = New RotateTransform3D (); Axis angleRotation 3D axis Axis = new axisangle rotation 3D (); Matrix 3D Model Het Coordinate = Model Hit.Transform.Value; RotateTransform.CenterX = modelHitCoordinates.OffsetX; RotateTransform.CenterY = 0.1; RotateTransform.CenterZ = modelHitCoordinates.OffsetZ; Axangle rotation.exis = new vector 3D (0, 1, 0); Axis finger Angle = 0; RotateTransform.Rotation = axisAngleRotation; If (m.ClickCount == 2) {axisAngleRotation.Angle + = 45; ModelHit.Transform = rotateTransform; }}}; }};  

Look at the type that you are changing if your type is "vector 3D" So the transform method will ignore the rotation center. I do not think this is correctly documented.

Both of you are rotating and the center should be of "point 3D".

The intention of the author of that method is legal. One direction in space (a "vector 3D") should not be dependent on the center of rotation, hence the additional translation of the rotation center should not be necessary. If you rotate a place in the 3D space (a "point 3D"), then the center of rotation works


Comments