C# Class Meshellator.Viewer.Modules.ModelEditor.Views.Trackball

/// Copied from 3D Tools, 3dtools.codeplex.com Trackball is a utility class which observes the mouse events on a specified FrameworkElement and produces a Transform3D with the resultant rotation and scale. Example Usage: Trackball trackball = new Trackball(); trackball.EventSource = myElement; myViewport3D.Camera.Transform = trackball.Transform; Because Viewport3Ds only raise events when the mouse is over the rendered 3D geometry (as opposed to not when the mouse is within the layout bounds) you usually want to use another element as your EventSource. For example, a transparent border placed on top of your Viewport3D works well: NOTE: The Transform property may be shared by multiple Cameras if you want to have auxilary views following the trackball. It can also be useful to share the Transform property with models in the scene that you want to move with the camera. (For example, the Trackport3D's headlight is implemented this way.) You may also use a Transform3DGroup to combine the Transform property with additional Transforms.
Afficher le fichier Open project: tgjones/meshellator

Méthodes publiques

Méthode Description
Trackball ( ) : System

Méthodes protégées

Méthode Description
OnTransformUpdated ( EventArgs e ) : void

Private Methods

Méthode Description
OnMouseDown ( object sender, System.Windows.Input.MouseEventArgs e ) : void
OnMouseMove ( object sender, System.Windows.Input.MouseEventArgs e ) : void
OnMouseUp ( object sender, System.Windows.Input.MouseEventArgs e ) : void
ProjectToTrackball ( double width, double height, Point point ) : Vector3D
Track ( Point currentPosition ) : void
Zoom ( Point currentPosition ) : void

Method Details

OnTransformUpdated() protected méthode

protected OnTransformUpdated ( EventArgs e ) : void
e System.EventArgs
Résultat void

Trackball() public méthode

public Trackball ( ) : System
Résultat System