Geomview
The machinery of Geomview is contained within the Object Oriented Graphics Library (OOGL) which was also developed by the Geometry Center at the University of Minnesota. All of the scenes that are displayed by Geomview are described in terms of OOGL objects. For example, a sphere in Geomview can be described in terms of the OOGL object called SPHERE. The type of object, as well as the physical description, can be passed to Geomview in an OOGL object file which, in the case of a simple sphere, would contain the following text:
SPHERE # name of the OOGL object 1.0 # radius of the sphere 0 0 0 # x,y,z coordinate of the center
If you open this file from within Geomview, a unit sphere will appear in the camera widget.
OOGL object files can also be composed of multiple OOGL objects. For example, a file describing a triangle slicing through the center of the above sphere would look like:
LIST # More than 1 OOGL object
{ # Separates the Objects
SPHERE # A OOGL Object
1.0 # Radius
0 0 0 # Center, x, y, z
}
{ OFF # Format for describing polyhedra
3 1 3 # Number of vertices, faces, edges
-2.0 2.0 0.0 # vertex 0
4.0 0.0 0.0 # vertex 1
-2.0 -2.0 0.0 # vertex 2
3 0 1 2 # number of vertices, and order to
# connect them
}
OOGL appears to be fairly complete in the sense that you can describe a variety of objects and their attributes within the context of the library. Other OOGL objects include meshes, Bezier surfaces, lines, and quadrilaterals. Each of these objects has appearance attributes such as surface color, surface reflectance properties, and edge colors that can be specified either from Geomview menus or within the OOGL object files. However, the Linux port (like several others) does not yet support transparency attributes.
One of the powerful features of Geomview is its graphical command language (GCL), which is rich enough to allow users to not only manipulate the displayed scene, but to change the appearance attributes and animate objects in it. These commands can be either typed directly into Geomview via a command widget or piped from an external program. To illustrate just how easy this is, consider the following example: Say you want to animate a pendulum in the viewer. You will first need to describe the pendulum in terms of OOGL objects and then swing the pendulum by rotating it about an axis that passes through the end of the string from which the bob hangs.
A simple pendulum can be described as two objects, a line for the string and a sphere for the bob. Or, in terms of a list object file which I call pendulum.list:
LIST # More than 1 OOGL object
{
SPHERE # A OOGL Object
1.0 # radius of the sphere
0.0 0.0 -5.0 # center of the sphere
}
{
VECT # A vector object
1 2 1 # lines, vertices, colors
2 # vertices in each line
1 # colors in each line
0.0 0.0 0.0 # vertex 0
0.0 0.0 -4.0 # vertex 1
1.0 0.0 0.0 1.0 # color of line
# (red, green, blue, alpha)
}
The VECT object describes the string of the pendulum which goes from the origin (vertex 0) to the top of the sphere (vertex 1). The last line describes the color of the string.
For illustrative purposes, I will also put a square 8 units long above the pendulum. This is described in terms of the quadrilateral object (QUAD) which I place in a file called ceiling.quad.
CQUAD # QUAD object with color # vertex descriptions are # (x, y, z, red, green, blue, alpha) -4.0 -4.0 0.0 0.0 0.0 1.0 1.0 # vertex 0 4.0 -4.0 0.0 0.0 0.0 1.0 1.0 # vertex 1 4.0 4.0 0.0 0.0 0.0 1.0 1.0 # vertex 2 -4.0 4.0 0.0 0.0 0.0 1.0 1.0 # vertex 3
The prefix C in front of QUAD indicates that the vertex colors are included next to the location of the vertices. That is, the first three numbers on each line describe a vertex of the ceiling, and the last four give the color and the reflection coefficient. All colors are expressed in terms of fractions of red, green, and blue and are usually followed by a reflection coefficient, which is ignored for the Linux port.
To animate the pendulum, a small C program is used to send GCL commands along a pipe connected between Geomview and the program's standard input and output. These commands tell Geomview to not only load the objects into the viewer, but also to rotate the pendulum about the x axis between -30 and +30 degrees in 1 degree increments.
#include <stdio.h>
main()
{
int i,j;
/* Select no normalization */
printf("(normalization g0 none)\n");
/* No bounding boxes */
printf("(bbox-draw g0 no)\n");
/* A 8X8 Plane */
printf("(load ceiling.quad)\n");
/* A sphere with a string */
printf("(load pendulum.list)\n");
/* Flush pipe to Geomview */
fflush(stdout);
/* Swing to +30 degrees */
for (i = 0; i < 30; i++)
printf("(transform \"pendulum.list\""
"g0 focus rotate 0.017 0.0 0.0)\n");
/* Swing to -30 degrees */
for (i = 0; i < 60; i++)
printf("(transform \"pendulum.list\""
"g0 focus rotate -0.017 0.0 0.0)\n");
/* Swing back to 0 */
for (i = 0; i < 30; i++)
printf("(transform \"pendulum.list\""
"g0 focus rotate 0.017 0.0 0.0)\n");
/* Flush pipe to Geomview */
fflush(stdout);
}
To see the results, compile the program with gcc pendulum.c. Next, start Geomview from this same directory and access the inspect menu and select commands. The command widget will pop up and you need to type (emodule-define pend a.out) to instruct Geomview to load the executable a.out as an external module named pend. If everything is working right, the module pend should appear in the external modules list and can be activated by clicking on the word pend. The pendulum and ceiling will appear in the camera widget and the pendulum will swing back and forth. You will have to use Geomview's tools to rotate the scene to the view shown in Figure 3.
The loading of the OOGL object files and animation of the above example is accomplished in just a few lines of C code and a total of 4 GCL commands. The first two GCL commands describe some characteristics of the “World” (g0) object which, in turn, are adopted by all objects that are loaded following these commands. By default, when an object is loaded into Geomview, the coordinates of the object are normalized so that the object fits within a unit sphere centered on the origin. The (normalization g0 none) command turns this option off. The second command tells Geomview not to draw black bounding boxes around each object that it loads. The third command, (load filename), tells Geomview to load the OOGL object file filename.
Most of the work is actually done by the fourth and final GCL command. transform tells Geomview to rotate the object pendulum.list by 0.017 radians (about 1 degree) around the x axis and 0 radians about the y and z axes. The other two arguments to transform, g0 and focus, specify that rotations are with respect to the center of the World object (g0) and are to be applied in the frame of reference of the camera. There are many other GCL commands described in the manual that can be used to animate and manipulate OOGL objects.
Although the examples illustrated here have been rather simple, it should be apparent that Geomview is a package with numerous applications. Geomview, in combination with powerful graphical user interface development tools, such as Tcl and Wish, can be used to create interactive 3-D applications in relatively short amounts of time. This is quite a powerful package that should not be ignored by anyone developing applications involving 3-D images or anyone needing an easy-to-use viewer to better visualize objects, whether he is viewing complex mathematical output from Mathematica or simple geometric relationships between lines and planes.
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Sponsored by AMD
Built-in forensics, incident response, and security with Red Hat Enterprise Linux 6
Every security policy provides guidance and requirements for ensuring adequate protection of information and data, as well as high-level technical and administrative security requirements for a system in a given environment. Traditionally, providing security for a system focuses on the confidentiality of the information on it. However, protecting the data integrity and system and data availability is just as important. For example, when processing United States intelligence information, there are three attributes that require protection: confidentiality, integrity, and availability.
Learn more about catching the bad guy in this free white paper.
Sponsored by DLT Solutions
| Dynamic DNS—an Object Lesson in Problem Solving | May 21, 2013 |
| Using Salt Stack and Vagrant for Drupal Development | May 20, 2013 |
| Making Linux and Android Get Along (It's Not as Hard as It Sounds) | May 16, 2013 |
| Drupal Is a Framework: Why Everyone Needs to Understand This | May 15, 2013 |
| Home, My Backup Data Center | May 13, 2013 |
| Non-Linux FOSS: Seashore | May 10, 2013 |
- RSS Feeds
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
- Using Salt Stack and Vagrant for Drupal Development
- Dynamic DNS—an Object Lesson in Problem Solving
- New Products
- Validate an E-Mail Address with PHP, the Right Way
- Drupal Is a Framework: Why Everyone Needs to Understand This
- A Topic for Discussion - Open Source Feature-Richness?
- Download the Free Red Hat White Paper "Using an Open Source Framework to Catch the Bad Guy"
- Tech Tip: Really Simple HTTP Server with Python
Enter to Win an Adafruit Pi Cobbler Breakout Kit for Raspberry Pi

It's Raspberry Pi month at Linux Journal. Each week in May, Adafruit will be giving away a Pi-related prize to a lucky, randomly drawn LJ reader. Winners will be announced weekly.
Fill out the fields below to enter to win this week's prize-- a Pi Cobbler Breakout Kit for Raspberry Pi.
Congratulations to our winners so far:
- 5-8-13, Pi Starter Pack: Jack Davis
- 5-15-13, Pi Model B 512MB RAM: Patrick Dunn
- 5-21-13, Prototyping Pi Plate Kit: Philip Kirby
- Next winner announced on 5-27-13!
Free Webinar: Hadoop
How to Build an Optimal Hadoop Cluster to Store and Maintain Unlimited Amounts of Data Using Microservers
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Some of key questions to be discussed are:
- What is the “typical” Hadoop cluster and what should be installed on the different machine types?
- Why should you consider the typical workload patterns when making your hardware decisions?
- Are all microservers created equal for Hadoop deployments?
- How do I plan for expansion if I require more compute, memory, storage or networking?




30 min 27 sec ago
5 hours 43 min ago
8 hours 55 min ago
11 hours 10 min ago
11 hours 39 min ago
12 hours 37 min ago
14 hours 6 min ago
15 hours 14 min ago
16 hours 1 min ago
22 hours 36 min ago