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.
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 1When 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.
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 1The 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 1Be 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.
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.
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).
#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; }
Comments to:
webmaster@www.geom.uiuc.edu
Created: Fri Sep 8 11:39:00 1995 ---
Last modified: Mon Dec 18 09:08:19 1995