From Solid Graphics Wiki
| SolidKit.Forms.Control3D class
|
| Namespace:
| SolidKit.Forms
|
| Base type:
| System.Windows.Forms.Control
|
| Assembly:
| SolidKit.dll
|
| Platform:
| .NET
|
|
The Control3D class can be used to create a window with 3D capabilities or to create 3D rendering context for off-screen rendering. The Control3D class then provides datamodel-independent 3D view navigation capabilities (such as view pan, rotate, zoom or walk functions), 3D objects manipulation capabilities (moving the objects or rotating them) to the window by handling mouse and keyboard actions in the window and translating them into corresponding window view projection changes.
The Control3D class is not intended to be used as main application form. For main application form use SolidKit.Forms.MainForm3D class instead.
See SolidKit Library sample projects for more information about how to use the Control3D class.
Features
The Control3D class provides provide these data-model-independent scene view navigation modes:
- rotate - freely rotate around xyz axes, or around any specified vector (axis)
- pan - freely move in xyz space, or in any specified plane
- zoom - zoom in, out, to specified window rectangle, to whole scene, to selected object
- fly view - change view direction using mouse or keyboard
- free look view (this is the same mode as used in first person shooter games) - walk move with "keeping the head-up direction)
- view angle control
The Control3D class allows this datamodel-independent manipulations of selected 3D scene objects:
- moving object freely in xyz space, or along a plane, or along specified vector. It is possible to set moving constraints, such as prohibiting to move an object beyond a specified limits. Moving objects in steps (snap to grid) is also supported.
- rotate objects freely along xyz axis, or around any specified vector. It is possible to set ratation constraints such as to prohibit to rotate object more or less than certain angles. Rotating objects in discrete steps (for example in 5 degree steps) is also supported.
- multiple objects can be selected, the moving or rotating is applied to all selected objects
The Control3D class also supports features, such as:
- customization of shortcut keys for view navigation (using the SolidKit.CommandTrigger class)
- printing of the 3D renders
- simple texture-based text printing
- antialiasing (accumulation buffer based)
- 3D objects selections and manipulation
How it works
The Control3D class manipulates the view's rendering context's projection and modelview matrices based on user's mouse pointer or keyboard interaction with the view depending on currently selected interaction mode. The view can be also navigated programatically by using navigation functions such as LookAt, Pan or Rotate.
The 3D scene objects manipulation is implemented by providing the object's position and rotation information to the Control3D class using the SolidKit3D.ObjectPosInfo class objects. The Control3D then interprets user's mouse pointer and keyboard actions in the view and updates object position and rotation information of provided ObjectPosInfo class instance.
How to use the Control3D class
- See Using the Control3D class main article ...
Constructors
- See Control3D class constructors for details.
Fields
| DefaultSettings
| Static variable which's settings are copied into Control3D object during it's construction. The DefaultSettings variable controls properties such as initial window projection (ortho or perspective), interaction mode, clipping distances, antialiasing quality.
|
| SolidKit.Forms.Control3D.ViewControlInfo.Default
| Static variable which's settings are copied into Control3D object during it's construction. It controls properties such as mouse sensitivity and command shortcuts.
|
| SolidKit.Forms.Control3D.ViewMovementInfo.Default
| Static variable which's settings are copied into Control3D object during it's construction. It provides properties such as shortcuts-controlled pan and rotation speed.
|
Properties
Handles, projection and clip distance settings
| Property name
| Description
|
View navigation
| Property name
| Description
|
Callbacks and Events
| Property name
| Description
|
Other properties
| Property name
| Description
|
| ScreenShot
| Returns screenshot of current frame as an System.Drawing.Bitmap object.
|
| CommandTrigger
| Gets or sets CommandTrigger for the Control3D object.
Settings control
Methods
Rendering context creation / close / information methods
Overridable command handlers
| OnWindow3DCommand
| Overridable method used to handle commands (such as move camera left, right, up, down; zoom in, zoom out; etc) send to the Control3D object.
|
Rendering methods
Antialiasing support (using accumulation buffer) methods
Note: the Control3D class supports antialiasing with using accumulation buffer only.
The Antialiasing methods below use value of AntialiasingQuality property.
View interaction control methods
| OnStartInteraction
| Overridable callback which is called by the Control3D object on start of each interaction (pan, rotate etc).
|
| OnEndInteraction
| Overridable callback which is called by the Control3D object on end of each interaction.
|
Objects selection support
View navigation API methods
Animation mode support methods
Printing support methods
| Print
| Prints frame into provided printer's device context.
|
| IsPrinting
| Returns true if printing for the Control3D object is in progress.
|
Overridable message handlers
OpenGL-specific wrapper methods
Coordinates transformations methods
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|