Using Real2Virtual Viewer
Formats
Use File->Open to load a Real2Virtual Model File (.m3d) or a Stereolithography file (.StL).
Alternatively you may import data from a file using the File->Import option
described below.
Changing the Viewpoint
The viewer may be used to view the model from
any angle, and at any distance away. The viewpoint can be controlled
using the keyboard, mouse movements, and toolbar buttons.
Keyboard Control
-
Left Arrow : Spin the viewsphere clockwise
about vertical.
-
Right Arrow: Spin anti-clockwise about
the vertical.
-
Down Arrow: Spin clockwise about the
horizontal
-
Up Arrow : Spin anticlockwise about the
horizontal
-
End : Stop spinning
-
Delete : Cycle through the Viewing Modes
see below
-
Insert : Move away
-
Home : Move in
Viewing Modes are,
-
Display Surfaces (default) : Render solid surfaces and texture data.
-
Display a Bounding Box : Render the bounding box of the model to show
orientation whilst keys/mouse are pressed, otherwise display as above.
-
Display Lines : Render the model as a set of lines.
-
Display Points : Render the model as a set of points.
Mouse Control
To rotate the object using the mouse simply
select a point somewhere in the view and drag it in the desired direction
of spin. When the mouse button is released the object stops moving.
To size the object select a point with the right mouse button and drag either towards or away from
the center of the object. Dragging away from the center increases the size of the displayed object,
whilst dragging towards it decreases the size.
Toolbar Control
The following toolbar buttons may be used to control viewpoint.
The arrows have the same function as the keyboard
arrows. The '+' button moves the object closer, and the '-' moves it
further away. The red button stops movement. The 'M' button cycles through
the viewing modes (see above), and the 'R' button resets the viewpoint.
Saving Views
Viewer may be used to save images of the object
in JPEG or Windows Bitmap format by selecting File->Save View. JPEG
images may be used as Simulated Views in
Real2Virtual Modeller, or used like ordinary JPEG images.
Viewer Settings
Select the File->Settings menu option and the following dialog is displayed,
The Background Colour group defines the colour of the display behind the model.
Enter the RGB (red, green blue) values for the colour. Note that each value should be between 0 and 1.
For example try black = (0,0,0), white = (1,1,1), yellow = (1,1,0) or cream = (0.9,0.9,0.8).
The Movement Speed group specifies how fast the object moves when using the keyboard keys
or the toolbar. You can specify the speed of translation (the + and - buttons or ins and home keys)
and rotation (the arrow buttons or the arrow keys) seperately.
The Always use these settings check-box allows the settings you choose to
be used every time Viewer is started. If this is not selected then changes
you make to the settings will be used during the current session, but next
time you start Viewer the previous settings will be used.
Select the Restore button to reset all the settings to their original values.
I.e. to the values that they had when the program was installed.
Importing Data
Select the File->Import menu option, the Import Dialog is displayed. Set the
parameters described bellow and then select Import to save the settings and choose a file to import.
Selecting OK saves the changes you have made to the settings without importing.
Selecting cancel discards the changes you make to the settings.
File Layout
Viewer supports two main file layout styles, both are based on describing the Faces that
together make up the surface of the model. A face is most commonly a triangle and as such has three points which describe it. However a face could have...
- 1 point per face : just a point
- 2 points per face : a line
- 3 points per face : a triangle
- 4 points per face : a rectangle
- 5 or more points per face: a polygon
Enter the number of points that make up a Face in the Number of points on each face edit box.
Next select one of the two layouts described below,
- List of Points : Here the data in the file describes a number of 3D points
with each point written in order x-coordinate,y-coordinate,z-coordinate. If there are N faces
each with M points per face (i.e. M=3 for triangles) the file should contain N*M points. Viewer
reads the first M points as the first face, the next M as the second face, and so on until the whole file is read.
- Points and Indices : Here a number of points are written as above, however faces are
defined by additional data written after the point data. The additional data is a set of Indices.
The indices refer to the points earlier in the file and
define the faces of the model by refering to the points that make them up.
For example if the model is a set of lines, defining three points x1,y1,z1,x2,y2,z2,x3,y3,z3,
as the point data and 0,1,1,2,2,0 as the indices (which always start from 0) would define lines connecting the 1st and 2nd points
, the 2nd and 3rd points, and the 3rd and 1st point. When using this method point data is always
expected to be first in the file, followed immediately by the indices.
Importing from text files
Select Text File in the File Format dropdown.
If Viewer cannot automatically calculate the number of model faces stored in the file you will
have to fill out part of the Detecting the number of faces options group.
- If you wish to tell Viewer the number of faces select the Enter Now option and enter the number in the Number of faces
edit box.
- If this information is stored in the file you are importing it must be on the first line.
You must tell viewer how to read the number from the text on the first line by setting the
Scanf first line edit box to contain C-style format specification for reading the number.
For those un-familiar with programming in C here are some examples,
- "%d" : would read a single whole number written at the start of the text file
- "faces=%d" : would read the number from a first line like "faces=100"
- "f %d" : would read from a line like "f 100"
Importing from binary files
Select Binary File in the File Format dropdown.
When reading binary files you must specify how the coordinates that make up the point data
are writtem. For example a point may be written as whole numbers (integers) or as decimal numbers
(float or double). Select the appropriate format from the Point Storage Format dropdown.
If Viewer cannot automatically calculate the number of model faces stored in the file you will
have to fill out part of the Detecting the number of faces options group.
- If you wish to tell Viewer the number of faces select the Enter Now option and enter the number in the Number of faces
edit box.
- If this information is stored in the file you are importing then you must enter the Byte Offset
from the start of the file to where the number, giving the number of faces in the file, is stored. You also need to
specify the size of the header information or equivalently the start of the actual shape data in the file.
For example if the header is just a single integer giving the number of faces in the file then
the Byte Offset is zero and Header Size would be 4 bytes ( for a 32-bit integer)
Real2Virtual Modeller Documentation Version
0.3
© Real2Virtual 2000-2002. All rights reserved.