-
Notifications
You must be signed in to change notification settings - Fork 263
ATF Model Viewer Sample
ModelViewer shows how to use ATF classes to load ATGI and Collada models and to render them using OpenGL®.
For details on how this sample is programmed, see Model Viewer Programming Discussion.
- Use of Managed Extensibility Framework (MEF) to put applications together.
- Use of the application shell framework, including
CommandService
,SettingsService
, andControlHostService
. - Use of components to handle files, such as
FileDialogService
,RecentDocumentCommands
, andStandardFileExitCommand
. - Using resource resolvers to load model files.
- Using a document and a client to handle documents of a certain type.
- Using adaptation and DOM adapters to handle DOM nodes in a variety of ways.
- Using a
DesignControl
canvas to display a graphic model. - Render ATGI and Collada documents using OpenGL®.
To run the sample, double-click ModelViewer.exe
in \bin\wws_atf\Release
.
A dialog appears with an empty canvas. You can open a model file to view it in the canvas.
- File
- Open 3D Model...: Open a 3D model file.
- Recent Files: Submenu with recent files you can open.
- Exit: Exit ModelViewer.
- Edit
- Keyboard Shortcuts: Use the *Customize Keyboard Shortcuts* window to set up keyboard shortcuts.
- Load or Save Settings: Use the *Load or Save Settings* window to save current ModelViewer application settings or load application settings from a file.
- Preferences: Set application preferences, such as command icon size.
- View
- Fit: Fit the model object in the window. Keyboard shortcut: F key.
- Smooth: View the model fully rendered.
- Wireframe: View a wireframe of the model.
- Outlined: View the model fully rendered with a wireframe.
- Textured: Toggle viewing the model with textures. Keyboard shortcut: T key.
- Lighting: Toggle viewing the model with shading. Keyboard shortcut: L key.
- Backface: Toggle rendering backfaces in the model. Keyboard shortcut: B key.
- CycleRenderModes: Cycle between the Smooth, Wireframe, and Outlined modes. Keyboard shortcut: space bar.
- Window:
- Tile Horizontal: Tile the windows horizontally; does nothing.
- Tile Vertical: Tile the windows vertically; does nothing.
- Tile Overlapping: Overlap the windows horizontally; does nothing.
- List of checked menu items for windows; check to display the corresponding window.
- Lock UI Layout: Lock the UI so that windows can't be moved.
- Help
- About: Display dialog with information about ModelViewer.
The tool buttons invoke functions also available from menu items:
- Lock UI Layout
- Smooth shading: Same as View > Smooth.
- Wireframe rendering: Same as View > Wireframe.
- Smooth shading with wireframe outline: Same as View > Outlined.
- Textured rendering: Same as View > Textured.
- Lighting: Same as View > Lighting.
- Render backfaces: Same as View > Backface. This mode is only apparent in Wireframe mode.
Open an ATGI (.atgi
extension) or Collada (.dae
) model file and it displays in the "3D View" window tab. Only one model displays at a time.
Click the tool buttons or menu items or use the keyboard shortcuts to change the manner of rendering.
You can choose only one of these renderings:
- Smooth: View the model fully rendered.
- Wireframe: View a wireframe of the model.
- Outlined: View the model fully rendered with a wireframe.
You can toggle these rendering modes:
- Textured. Keyboard shortcut: T key.
- Lighting. Keyboard shortcut: L key.
- Backface. Keyboard shortcut: B key.
Modules perform these functions:
- Program.cs: Contains the
Main()
function. It creates a MEFTypeCatalog
listing the ATF and internal components used. - ModelDocument.cs: Defines the
ModelDocument
class for a document of a model file. - ModelViewer.cs: Specifies the
ModelViewer
component, which is the document client for aModelDocument
. - RenderView.cs:
RenderView
component that registers aDesignControl
control to display a 3D scene from a model document. - RenderCommands.cs:
RenderCommands
component provides user commands related to theRenderView
component to change rendering mode. - RenderPrimitives.cs:
RenderPrimitives
class DOM adapter that does the work of rendering the model, using OpenGL®. - RenderTransform.cs:
RenderTransform
class DOM adapter that applies the appropriate transform for rendering objects so they appear in the proper place in the model.
- CircuitEditor: Editor for circuits, consisting of modules with input and output pins and connections between them.
- CodeEditor: Code editor that uses the ActiproSoftare SyntaxEditor to provide an editing Control.
- DiagramEditor: Combines the Circuit, Finite State Machine, and State Chart editors into a single application to show how multiple editors can share an application shell and editor components.
- DOMPropertyEditor: Demonstrates property editing, with a large variety of property editing controls and property descriptors.
- FileExplorer: Shows how to build a simple Windows® Explorer-like application to view the contents of a disk.
- FSMEditor: Finite state machine editor.
- ModelViewer: Shows how to use the ATF's ATGI and Collada file loaders and OpenGL® rendering.
- SimpleDOMEditor: Demonstrates the use of the DOM (Document Object Model) in WinForms, including defining a data model.
- SimpleDOMEditorWPF: Similar to ATF SimpleDOMEditor Sample, but implemented using ATF’s WPF framework.
- SimpleDOMNoXMLEditor: Very similar to the SimpleDOMEditor sample, but does not use XML.
- StateChartEditor: Editor for statecharts.
- TargetManager: Shows how to use the TargetEnumerationService to discover, add, configure and select targets, which are network endpoints, such as TCP/IP addresses, PS3™ DevKits or PlayStation®Vita DevKits.
- TimelineEditor: Relatively full-featured timeline editor whose components have been used in real production tools.
- TreeListControl: Demonstrates the usage of TreeListControl/TreeListItemRenderer classes to display and edit hierarchical data in a tree view with details in columns.
- TreeListEditor: Shows how to create and add entries to various kinds of Tree lists, including a hierarchical list to display selected folders' underlying folders and files.
- UsingDirect2D: Demonstrates how to use Direct2D and ATF classes that support Direct2D.
- UsingDom: Simple demo of basic DOM use.
- Home
- Getting Started
- Features & Benefits
- Requirements & Dependencies
- Gallery
- Technology & Samples
- Adoption
- News
- Release Notes
- ATF Community
- Searching Documentation
- Using Documentation
- Videos
- Tutorials
- How To
- Programmer's Guide
- Reference
- Code Samples
- Documentation Files
© 2014-2015, Sony Computer Entertainment America LLC