Running
Running
The viewer will generally be run by double-clicking its program icon. Once the viewer has started, all the important options can be configured from within the program itself.
It's also possible to run the viewer from a command line. This method is detailed below.
Command Line Options
The general form for running the viewer from the command line is: OgreMaxWinViewer.exe options FileName where the case-insensitive options are optional and FileName is the name of your scene or mesh file.
Options
- -LockViewCamera - Locks the main view camera to the currently selected camera. This will be used when viewing a scene with animated cameras. Note that if you adjust the view camera in any way (by moving the mouse, keyboard or gamepad) the locking is turned off. See controls for details on turning view camera locking on and off at runtime.
- -zUp - Indicates that the scene up axis should be the z axis. This is only used if a mesh file is being viewed. By default, the y up axis is used.
- -ResourcesConfigFile or -r - Specifies the path to the resources configuration file. By default, OgreMaxViewerResources.cfg is used.
- -Zip or -z - Specifies the path to a zip file resource location.
- -OutputDirectory, -ODir, or -o - Specifies the path to a directory where any output files are written.
- -Directory, -Dir, or -d - Specifies the path to a directory resource location.
- -RDirectory, -RDir, or -rd - Specifies the path to a directory resource location that is searched recursively.
- -PluginsConfigFile or -p - Specifies the path to the plugins configuration file. By default, OgreMaxViewerPlugins.cfg is used. This option is ignored if the viewer has been compiled with the static Ogre libraries.
- -Width - Specifies the width of the main window. By default, the width is 800.
- -Height - Specifies the height of the main window. By default, the height is 600.
- -Direct3D or -D3D - Indicates that the Direct3D rendering system should be used. This is the default on Windows.
- -OpenGL or -OGL - Indicates that the OpenGL rendering system should be used. This is the default on non-Windows platforms.
- -VSync - Indicates vertical synchronization should be enabled. By default, vertical sync is disabled.
- -ScreenshotBaseName - Indicates base name that screenshot files will have. By default, the base name is Screenshot.
- -ScreenshotExtension - Indicates the file extension that screenshot files will have. The extension's leading '.' character is optional. By default, the file extension is .jpg.
- -WriteUserControlsFile - Indicates that the UserControls.xml file should be written when the viewer exits. This file is used to configure the viewer controls. By default, the UserControls.xml file is not written. Note that if this file is present it will always be read.
- -KeepLogFile - Indicates that the log file should not be deleted when the viewer exits. By default, the log file is deleted.
- -NoInfo - Indicates that the side bar (containing the scene tree) should initially be hidden. By default, the side bar is visible.
- -NoStartupFileDialog - Indicates no startup dialog should appear if a file is passed in on the command line.
- -NVPerfHUD - Enables the NVidia performance heads-up display. By default, the heads-up display is not shown. Note that when using the NVidia PerfHUD tool, you must not resize the viewer window since it may cause a program crash. Also, for best results, use the newest version of the PerfHUD tool.
Example Usage
OgreMaxWinViewer.exe -Width 1024 -Height 768 -VSync -D3D -LockViewCamera -ScreenshotBaseName MyScreenshot -ScreenshotExtension .bmp "c:\My Directory\My Scene.scene"
Scripting
You may write a Lua script file to control the viewer. Such a file is typically in the same directory as the viewed file, and must be named FileName.lua, where FileName is the file name (including the extension). If present, this file will automatically be loaded. The following script functions will be called if they are defined:
- function Activating(scene) - Called once, when the scene is loaded.
- function Deactivating(scene) - Called once, when the scene is unloaded.
- function Update(scene, elapsedTime) - Called once per frame.
For a working demonstration of how to use a Lua scene script file see the MeshAnimation sample.
Drag-and-Drop
The OgreMax WinViewer supports drag and drop of scene and mesh files.