Up: Geomview FAQ Table of Contents
Prev: Geomview FAQ General Questions
Next: Geomview FAQ Implementation Specific Questions

Geomview FAQ

Data Presentation

How do I create a image of a scene for publication?

This is complicated question whose answer depends on the version of Geomview you're running, the software installed at your site, and the quality of the image you want. Read this entire answer to decide which method will be best for you.

The "PS Snapshot" external module saves a scene in Postscript format. This method of creating an image works on all platforms. Click on "PS Snapshot" in the modules list to start it. PS Snapshot will draw the currently selected object from the viewpoint of the current camera. Select the object you want to capture (or select "World" for the whole scene), pick the options you want on the Snapshot panel, then click on "Save postscript snapshot". Enter the filename and select "Ok". This will give you a postscript image scaled to fill a 8.5x11 inch page ready to be printed or imported to other programs. This method has advantages and disadvantages. 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 PS Snapshot can't perform smooth shading, ignores appearance and lighting changes made with Geomview, and that intersecting objects and some other ill-conditioned scenes will be drawn incorrectly.

The X11 version of Geomview currently requires you to have XV (or some other image grabbing utility) installed to create an image exactly like the one displayed. Start XV, click the "Grab" button, then click on the Geomview camera window. XV then grabs an image you can save in various formats. The requirement of a external image grabber will be removed in the next release.

On the SGI, to create an image exactly like the one displayed, select the camera you want, then click on "Save" on the main panel. In the panel that appears, select the "SGI Snapshot" save option, enter the filename, and click "Ok". The image is stored in SGI image format, which SGI's Showcase (command "showcase") understands.

On NeXT workstations, use the "/NextApps/Grab.app" application to make a TIFF snapshot of the camera window. You will then have a TIFF image file which you can modify and use as needed. However, the quality of this image isn't great -- you will see jagged edges. To create a high-resolution version with transparency and better lighting, first select the camera you want and then choose "Print" from Geomview's menu. Set the options to what you want on the panel that appears, then click either "Save..." or "Print". Creating the image will take some time.

If you have Photorealistic Renderman (a commercial product of Pixar), 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 line about fifteen lines that begins with "Format", ie. "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.


How can I display a collection of points?

The most efficient way to display points in Geomview is to use the VECT file format. This file format is mainly used for building shapes made out of lines but we can also use it to specify lines that contain only one vertex (i.e. points). Let's take a look at an example VECT file that describes 3 points colored red, green and blue:
VECT
3 3 3      # num. of polylines, num. of vertices, num. of colors.

1 1 1      # num. of vertices in each of the 3 polylines,
           # in this case only 1 for each since we are doing points.

1 1 1      # num. of colors supplied for each polyline.

-1 -.2 0   # Here are the coordinates of each point.
 1 -.2 0
 0  .9 0

1 0 0 1    # Color for each vertex in RGBA format.
0 1 0 1
0 0 1 1
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.


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. Unfortunately, linewidth is supported only in the X11 and SGI versions of Geomview, not in the NeXTstep version. 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 "transform" 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.


How do I put text into a scene?

If you are using the SGI version of Geomview, you can use the labeler, a tool which creates nice looking text objects given a text string and a Postscript font. You can get it via anonymous ftp from

ftp.geom.umn.edu in the directory /pub/software/geomview/newpieces/sgi.

The external module version of this tool only runs on SGIs (it uses the FORMS interface library). The core program should run on other machines that have Display Postscript extension for X. The text produced is high quality, but the large number of polygons used slows down Geomview.

Another option is to use a file of ready-made letter geometries, alphabet.vect, which is part of the standard Geomview distribution. (Note this file is not intended for viewing.) It defines each letter as a handle to a few vectors. Geomview can handle quite a bit of this text in the scene before slowing down. Instructions for using this file are in a comment at the start of the file.

If you don't need the text to be a 3D object in the scene, you can create a image or postscript file of the scene (see previous question) and then use an image editor such as Showcase, Illustrator, or XPaint to annotate it with text.


Why don't objects appear in the right places?

When objects aren't appearing where you think they should, it's probably because normalization is on by default. Normalization simply scales an object's bounding box to fit into a unit sphere, with the center of the bounding box translated to the origin. This is useful when examining a single object, as you can easily view the whole object without having to worry about how big it is. However, it also means that if you're loading multiple objects that are supposed to belong in the same coordinate system, all the objects will be scaled and placed at the origin. The process of turning off normalization varies with the platform: Whatever your platform, when you turn off normalization your objects will probably vanish. This is because the unnormalized objects do not lie in the camera's viewing cone. The easiest way to see everything is to choose the "World" object in the Object Browser, then click on "Look At" in the Tools Panel.


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.

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 the man page (by typing man animate).


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. Some free packages are Bob and Volvis. Commercial packages include AVS and Explorer.


Can Geomview do texture maps?

There's no way at present (short of extremely crude things like a CMESH object with each vertex colored according to an image pixel). However, there are plans in the works to add texture mapping in the future.


I have an OFF file that Geomview can't read.

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"
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;
}


Up: Geomview FAQ Table of Contents
Prev: Geomview FAQ General Questions
Next: Geomview FAQ Implementation Specific Questions

[HOME] The Geometry Center Home Page

Comments to: webmaster@www.geom.uiuc.edu
Created: Fri Sep 8 11:39:00 1995 --- Last modified: Mon Dec 18 09:08:19 1995