When loading this file into Geomview, you will probably need to turn off
the bounding box (via the appearance panel), otherwise you may not be
able to see the points.
4.4 How do I make the points larger?
By default, the thickness of lines and points in Geomview is 1. This may
be okay for most lines, but it causes each point to occupy only one
pixel on the computer screen. You can change line and point thickness by
adding an appearance tag to the top your geometry file that looks like
this:
appearance
linewidth 4.
In this case, we have increased our line/point size to 4 and any points
we have in our file will now appear as small disks. You can also change
the line width using the Appearance panel. What Geomview actually does
is render each point as a many sided polygon which approximates a disk.
If you want the points to appear as solid 3-dimensional objects, such as
tiny spheres, you can use a completely different method for representing
them: an INST object with multiple transforms. This lets you specify an
arbitrary geometric shape to be used to represent the points. For
example, the following file represents the three points (1.5, 2.0, 0.1),
(1.0, 0.5, 0.2), and (0.5, 0.3, 0.2) using small cubes:
INST
geom {
OFF
8 6 12
-0.05 -0.05 -0.05
0.05 -0.05 -0.05
0.05 0.05 -0.05
-0.05 0.05 -0.05
-0.05 -0.05 0.05
0.05 -0.05 0.05
0.05 0.05 0.05
-0.05 0.05 0.05
4 0 1 2 3
4 4 5 6 7
4 2 3 7 6
4 0 1 5 4
4 0 4 7 3
4 1 2 6 5
}
transforms
1 0 0 0 0 1 0 0 0 0 1 0 1.5 2.0 0.1 1
1 0 0 0 0 1 0 0 0 0 1 0 1.0 0.5 0.2 1
1 0 0 0 0 1 0 0 0 0 1 0 0.5 0.3 0.2 1
#
# these are the matrices:
#
# 1 0 0 0 1 0 0 0 1 0 0 0
# 0 1 0 0 0 1 0 0 0 1 0 0
# 0 0 1 0 0 0 1 0 0 0 1 0
# 1.5 2.0 0.1 1 1.0 0.5 0.2 1 0.5 0.3 0.2 1
The OFF object between "geom {" and "}" is the cube. The three lines
after the word "transforms" are 4x4 transforms, one for each point. Note
that you can use any valid OOGL expression for the geometry; for
example, if you want to use small dodecahedra to represent points, you
could repace the above OFF object with the following, which references
the dodecahedron object in the file dodec.off (distributed with
Geomview), scaling it by 0.05:
INST
geom {
INST
geom { < dodec.off }
transform
.05 0 0 0
0 .05 0 0
0 0 .05 0
0 0 0 1
}
transforms
1 0 0 0 0 1 0 0 0 0 1 0 1.5 2.0 0.1 1
1 0 0 0 0 1 0 0 0 0 1 0 1.0 0.5 0.7 1
1 0 0 0 0 1 0 0 0 0 1 0 0.5 0.3 0.2 1
Be aware that the more complicated the geometry you use for your points,
the longer it will take Geomview to refresh the window. This can be
important if you're dealing with a large number of points, in which case
you should stick to very simple point shapes or use the method of
displaying points in - VECT - format.
4.5 How do I put text into a scene?
You have two options:
- You can use the Labeler external module, which gives you a GUI for
typing text and selecting the font: either vector or a polygonalized
version of an installed font. However, you need to position the text
in the 3D scene, either by hand or with some other module like
Transformer.
- You can use the hvectext command-line utility program for Hershey
vector fonts, which does let you specify a position for the text.
You would then need to load the resulting file into Geomview.
If you don't need the text to be a 3D object in the scene, you can
create an image http://www.geomview.org/FAQ/answers.shtml#images or postscript http://www.geomview.org/FAQ/answers.shtml#ps
file of the scene and then use an image editor such as Illustrator,
Showcase, or XPaint to annotate it with text.
4.6 Can Geomview do volume visualization?
No, Geomview is intended to do surface visualization. You can either
create an isosurface and then view it using Geomview, or use a volume
visualization package. The free vtk http://www.vtk.org/
visualization toolkit has extensive support for volume visualization, as
do commercial packages like AVS http://www.avs.com, Iris Explorer
.
http://www.nag.co.uk/Welcome\_IEC.html, or IBM Data Explorer
. http://pic.dhe.ibm.com/infocenter/dataexpl/v8r2/index.jsp. Volvis
http://labs.cs.sunysb.edu/labs/vislab/volvis/ is free software specifically for
volume visualization.
4.7 Can Geomview do texture maps?
Yes, in release 1.6 and higher, but only in the OpenGL version, not in
the X11 version.
4.8 Why can't Geomview read my OFF file?
This is probably due to a different interpretation of how an OFF should
be written. Geomview indexes vertices starting at zero, while some other
programs are known to start at one. The following C program will convert
a plain one-indexed OFF to a zero-indexed OFF.
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main(void) {
char s[256];
int v, f, i, n, t;
gets(s);
if (strcmp(s, "OFF")) {
fprintf(stderr, "not an OFF\n");
exit(1);
}
puts(s); gets(s); puts(s);
sscanf(s, "%d %d %d", &v, &f, &i);
for (i=0; i!=v; ) {
gets(s);
if (strlen(s)) {
puts(s); i++;
}
}
for (i=0; i!=f; i++) {
scanf("%d", &n);
printf("\n%d", n);
for (v=0; v!=n; v++) {
scanf("%d", &t);
printf(" %d", t-1);
}
}
printf("\n");
return 0;
}
4.9 How can I animate a sequence of Geomview/OOGL files?
You might try using Animator, an external module that is distributed
with all versions of Geomview. With Animator, you can tell Geomview to
read in a sequence of OOGL files and then play through this sequence
forwards, backwards and also in single frame steps using the VCR like
interface 1.
To use Animator click on the Animator entry in Geomview's External
Modules browser. If it does not appear in the browser, then Geomview has
probably not been installed properly. For more information about
Animator read the info panel available through the program or the
man page (by typing man animate).
5 Output
5.1 How can I create a video animation (MPEG/ QuickTime/animated GIF)?
There are several variants of this question:
- first variant
> I would like to save a sequence of ppm snapshot files of a single
> off object while it is rotating so that I can convert the sequence
> into a movie. The only method I know of is to rotate the object
> slightly with the mouse, stop the motion, and save each frame
> individually. Is there a faster more automatic method, such as a
> command script. If so, do you have a sample command script that I
> could modify?
Two options:
- If the motion is axis-aligned, it's pretty easy to use the
rotate and snapshot GCL commands together:
(snapshot targetcam /tmp/foo%03d.rgb)
(transform world world world rotate .1 0 0)
(snapshot targetcam /tmp/foo%03d.rgb)
(transform world world world rotate .1 0 0)
and so on. The snapshot commanad auto-increments the filename.
- But for a more complex motion than the simple rotation around
the x axis that I have above, consider using StageTools, which
is a suite of tools designed to help people easily make
animations from Geomview. StageTools is included as a module in
recent versions, but if you need to download it is available at
http://www.geom.umn.edu/software/StageTools/.
- second variant
> I have used Geomview to view movies with the animation tool. How can
> I convert that movie to another animated format (e.g. an animated
> GIF) so that I can put it on display in a web page, viewable by
> someone without Geomview?
It's true that StageTools will do this and much more too. But
there's also a very easy way to do this directly inside the Animate
module: the Command function will run an arbitrary GCL command after
each frame. So to automatically take snapshots at each frame, you'd
hit the Command button and type something like
(snapshot c0 /tmp/foo%03d.rgb)
into the text field. Then when you hit play you'll see that it's now
jerky since it's saving an image off to disk each time. You might
want to turn on the "Once" radio button so that it stops after
running through each frame once. Then you can use your program of
choice to create an animated gif or quicktime movie from this bunch
of image files. For instance, on the SGIs you could do this with
"mediaconvert".
5.2 How can I save a picture of exactly what I see in a camera window?
Make sure that the camera window you want is the active one, then select
the "Save" item of the "File" menu on the main panel (or use the ">"
hotkey). In the panel that appears, there is a choice box that is set to
Command by default. Select one of the snapshot options, enter the
filename in the Selection input, and click "OK".
In the SGI version, you have three image snapshot choices: SGI screen,
PPM screen, and PPM software. Both the screen choices literally save the
onscreen pixels into a file, in either SGI (aka RGB) or PPM format. The
PPM software choice will rerender the image into an offscreen buffer
using the software renderer from the vanilla X version of Geomview.
Thus, it might not be pixel by pixel identical to what you see.
In the X11 version, you have only the PPM choices.
5.3 How can I make a true PostScript file that looks good at multiple resolutions instead of just converting a bitmap into PostScript?
Make sure that the camera window you want is the active one, then select
the "Save" item of the "File" menu on the main panel (or use the ">"
hotkey). In the panel that appears, there is a choice box that is set to
Command by default. Select the PostScript snapshot option, enter the
filename in the Selection input, and click "OK".
This method has advantages and disadvantages, compared to saving an
image bitmap. The advantage is that the result is resolution independent
- you can print it on a high resolution printer and not see any jagged
edges. The disadvantages are that our PostScript renderer can't do
smooth shading and uses the painter's algorithm for hidden surface
removal. The latter means that intersecting objects and some other
ill-conditioned scenes will be drawn incorrectly, or even that closer
objects will be drawn behind faraway objects. It often works, but not
always.
5.4 Why does my PostScript snapshot look wrong?
See previous answer.
5.5 How can I make a high quality image with RenderMan?
If you have Photorealistic Renderman (a commercial product of Pixar), or
BMRT (Blue Moon Rendering Toolkit, a public domain implementation), you
can create high quality images with transparency and more accurate
lighting in the SGI and X11 versions. To do this, bring up the Save
panel and select "RMan [->tiff]" from the save options. Enter a filename
and click "Ok". Bring up a shell window and change directory to where
you saved the file. Type "render /filename/" (where /filename/ is the
name you saved as). When this finishes, you will have an high quality
image in "/filename/.tiff". To create a higher resolution image (to
reduce jagged edges), edit the file you saved. There will be a line
about fifteen lines down from the top that begins with "Format", i.e.
"Format 450 450 1". The first two numbers are the resolution of the
created image. Change these to what you like (you should keep the ratio
of the numbers the same to avoid distortion), then render the file again.
6 X Specific Questions
6.1 How do I speed up the X11 version?
See the discussion of rendering options in the next question.
6.2 What do the Z-Buffer and Dithering controls in the Cameras panel do?
These control allow you to change how the X11 version renders objects.
The dithering checkbox, which only appears when running on an eight bit
display, allows you to turn dithering on and off. Dithering is the
method by which Geomview uses a small set of colors (less than 217) to
show any color you request. This is done by placing pixels of slightly
different color next to each other and letting your eye blend them
together. Unfortunately, it takes a fair bit of computing to do this.
Turning it dithering off will speed up rendering, but colors used won't
be exactly what you want. Depending upon your scene, this may be an
acceptable tradeoff.
The Z-Buffer popup menu allows you to select between three different
methods of hidden line/surface removal: z-buffering, depth sort, and
none. Z-buffering is the most accurate and enables the near and far
clipping planes. Depth sort uses less computing, but will be inaccurate
if objects intersect (polygons will pop in front when they should be
partially obscured) and in certain other circumstances (long, narrow
polygons close to other polygons are one example). Depending on your
scene, using this method could look just the same as z-buffering but be
much faster. The "None" option turns off all hidden line/surface
removal. This is only recommended for a scene which consists of just
lines in one color.
6.3 What does "Not enough colors available. Using private colormap" mean?
This happens when using the X11 version on an eight bit display
(currently common on workstations). An eight bit display can only show
256 colors simultaneously. These colors are shared by all the programs
running. Once a colorcell has been allocated by an application, its
color is fixed. Geomview tries to grab many colors when it starts. If it
fails to get them, it prints this message and uses a private colormap. A
private colormap means that Geomview now has access to all 256
colorcells. Unfortunately, these colors will only be displayed when the
cursor is inside one of Geomview's windows. The switching of colormaps
when the cursor enters and leaves the windows will give a technicolor
look to the rest of the display.
If you don't like the technicolor effect, you will have to quit the
programs which are using up colormap space. Examples of programs which
use lots of colormap space are background pictures, image viewers,
visualization software, and WWW browsers.
6.4 What does "Shared memory unavailable, using fallback display method" mean?
The X11 version of Geomview uses the shared memory extension to move
images quickly between the program and the X server. However, this
method of communicating with the X server only works when running
Geomview on the same machine as the display. If Geomview can't use
shared memory, it prints this message and goes back to using standard X
calls. Everything will work the same, it will just run much slower,
especially if you're running over the network.
6.5 Why do I get compiler errors about including files Xm/*.h?
You're trying to compile the X11 version and the compiler can't find the
Motif header files. If you have Motif but the headers are in a
nonstandard place, change the "SYSCOPTS" in your
makefiles/mk.$MACHTYPE file. If you don't have Motif, you won't be
able to compile Geomview. In this case, use one of the binary
distributions, if you can.