301 lines
13 KiB
HTML
301 lines
13 KiB
HTML
<!--startcut ==========================================================-->
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
|
|
<HTML>
|
|
<HEAD>
|
|
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
|
|
<META NAME="GENERATOR" CONTENT="Mozilla/4.03 [en] (X11; I; Linux 2.0.30 i486) [Netscape]">
|
|
<TITLE>Graphics Muse
|
|
</TITLE>
|
|
</HEAD>
|
|
<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000FA" VLINK="#FA3333" ALINK="#33CC33">
|
|
<!--endcut ============================================================-->
|
|
|
|
<H4>
|
|
"Linux Gazette...<I>making Linux just a little more fun!</I>"
|
|
</H4>
|
|
|
|
<P> <HR> <P>
|
|
<!--===================================================================-->
|
|
|
|
<!-- =============================================================
|
|
This Page Designed by Michael J. Hammel.
|
|
Permission to use all graphics and other content for private,
|
|
non-commerical use is granted provided you give me (or the
|
|
original authors/artists) credit for the work.
|
|
|
|
CD-ROM distributors and commercial ventures interested in
|
|
providing the Graphics Muse for a fee must contact me,
|
|
Michael J. Hammel (mjhammel@csn.net), for permission.
|
|
============================================================= !--><A NAME="musings"></A>
|
|
<TABLE>
|
|
<TR>
|
|
<TD>
|
|
<H2>
|
|
More...</H2>
|
|
<IMG SRC="../gx/hammel/musings.gif" ALT="Musings" HEIGHT=52 WIDTH=247 ALIGN=LEFT> </TD>
|
|
</TR>
|
|
</TABLE>
|
|
|
|
<TABLE>
|
|
<TR>
|
|
<TD></TD>
|
|
</TR>
|
|
</TABLE>
|
|
<IMG SRC="../gx/hammel/cleardot.gif" ALT="indent" VSPACE=5 HEIGHT=1 WIDTH=1 ALIGN=LEFT>
|
|
<TABLE WIDTH="100%" >
|
|
<TR>
|
|
<TD ALIGN=RIGHT WIDTH="100%"><FONT SIZE=-2>© 1998 <A HREF="mailto:mjhammel@csn.net">Michael
|
|
J. Hammel</A> </FONT></TD>
|
|
</TR>
|
|
|
|
<TR>
|
|
<TD VALIGN=TOP BGCOLOR="#000000" cellpadding="0" cellspacing="0"><IMG SRC="../gx/hammel/cleardot.gif" ALT="indent" ALIGN=LEFT></TD>
|
|
</TR>
|
|
</TABLE>
|
|
<A NAME="1"></A>
|
|
<H2>
|
|
XFPovray 1.2.4/1.3.1</H2>
|
|
Recently I was commissioned to work on another cover for the Linux Journal.
|
|
The cover will be out in a few months and I don't want to say too much
|
|
about it right now, but part of what I needed to do for it was create some
|
|
3D text. I've been familiar with how to do this for some time, using
|
|
any of a number of tools: AC3D, POV-Ray, Font3D, and so forth. I
|
|
have found the quickest 3D text can be created using Font3D and POV-Ray.
|
|
The results are generally pretty good. I hope to give you some insight
|
|
into Font3D and its XForms front end, XFont3D, next month.
|
|
|
|
<P>After the fonts were created I needed to run POV-Ray. This is
|
|
a terrific command line tool for creating 3D images that uses its own language
|
|
for defining a 3D scene. The scene file is fed to the rendering engine
|
|
using any combination of the many command line options. The only
|
|
real problem with POV-Ray is that is has so many options it is easy to
|
|
forget which ones use which particular syntax.
|
|
|
|
<P>Fortunately, <A HREF="mailto:mallozzir@cspar.uah.edu">Robert S. Mallozzi
|
|
</A>has written a very useful XForms based front end to the POV-Ray renderer:
|
|
<A HREF="http://cspar.uah.edu/~mallozzir/html/xfpovray.html">XFPovray</A>.
|
|
The tool, like many for Linux, is available in source. It requires
|
|
the <A HREF="http://bragg.phys.uwm.edu/xforms">XForms</A> v0.88 or later
|
|
library and will work with <A HREF="http://www.povray.org">POV-Ray 3.0</A>.
|
|
I had been running the 1.2.4 version for the work on the cover art, but
|
|
while writing this article I found that Robert had released a newer version.
|
|
I downloaded that one and had no problems building it. Its just a
|
|
matter of editing 2 files (if necessary), and running <B>xmkf; make; make
|
|
install.</B> You'll need to be root to run the default install, since
|
|
the Imakefile is set up to install in /usr/local/bin.
|
|
<BR>
|
|
<CENTER><TABLE BORDER=0 COLS=2 WIDTH="450" NOSAVE >
|
|
<TR NOSAVE>
|
|
<TD ROWSPAN="2" NOSAVE>
|
|
<TABLE BORDER=0 COLS=1 WIDTH="100%" NOSAVE >
|
|
<TR>
|
|
<TD><IMG SRC="./gx/hammel/xfpovray-1.jpg" HSPACE=10 VSPACE=10 HEIGHT=162 WIDTH=311></TD>
|
|
</TR>
|
|
|
|
<TR NOSAVE>
|
|
<TD ALIGN=CENTER NOSAVE><B>Figure 1: XFPovray v1.3.1 interface</B></TD>
|
|
</TR>
|
|
|
|
<TR NOSAVE>
|
|
<TD NOSAVE>The interface to 1.3.1 is a little different from the 1.2.4
|
|
version, using a smaller footprint for the initial window. The Render
|
|
options are also now in a notebook widget. Overall the interface
|
|
is more compact. Unfortunately, I found that something
|
|
wasn't quite right with my configuration. At times the menus would
|
|
not cause window refreshes when the menu was close, leaving bits of the
|
|
menus covering other parts of the underlying windows. This may be
|
|
a bug in XForms 0.88, but the 1.2.4 version of XFPovray didn't seem to
|
|
have this problem. Because of this, I'm going to review the 1.2.4
|
|
version, with just a few comparisons made to the 1.3.1 version. The
|
|
features of both are very similar and both versions are available on the
|
|
XFPovray web site. If you have problems with the 1.3.1 version you
|
|
can grab the 1.2.4 version. </TD>
|
|
</TR>
|
|
</TABLE>
|
|
</TD>
|
|
|
|
<TD NOSAVE><IMG SRC="./gx/hammel/xfpovray-1b.jpg" HSPACE=10 VSPACE=10 HEIGHT=396 WIDTH=279></TD>
|
|
</TR>
|
|
|
|
<TR NOSAVE>
|
|
<TD ALIGN=CENTER NOSAVE><B>Figure 2: XFPovray 1.2.4 interface</B></TD>
|
|
</TR>
|
|
</TABLE></CENTER>
|
|
XFPovray provides the user the ability to run the POV-Ray renderer on existing
|
|
scene files and to edit those files. To edit a scene file you need
|
|
to first configure the editor of choice. Select the <I>Options->Configure
|
|
</I>menu item from the menu bar of the main window. A dialog will
|
|
open allowing you to configure the editor you wish to use, along with the
|
|
location of the POV-Ray executable, an image viewer and a number of other
|
|
general items. After you click on the Accept button you will need
|
|
to use the <I>Options->Save State </I>menu option to save the configuration
|
|
to XFPovray's configuration file directory. This wil be $HOME/.xfpovray
|
|
by default.
|
|
|
|
<P>Once you've selected an editor you are ready to edit a file. Click
|
|
on the Scene File button to open a dialog box. This button sets the
|
|
default scene file to be rendered. You should do this first before
|
|
trying to edit any of your include files. The dialog box that opens
|
|
is a file selection box. This dialog has changed in the 1.3.1 version
|
|
to a format that is a little more standard for such dialogs. Figures
|
|
3 and 4 show the two versions of the file selection dialog.
|
|
<BR>
|
|
<TABLE BORDER=0 COLS=2 WIDTH="100%" NOSAVE >
|
|
<TR NOSAVE>
|
|
<TD ALIGN=CENTER NOSAVE><IMG SRC="./gx/hammel/xfpovray-3.jpg" HSPACE=10 VSPACE=10 HEIGHT=355 WIDTH=313></TD>
|
|
|
|
<TD ALIGN=CENTER NOSAVE><IMG SRC="./gx/hammel/xfpovray-4.jpg" HSPACE=10 VSPACE=10 HEIGHT=335 WIDTH=362></TD>
|
|
</TR>
|
|
|
|
<TR NOSAVE>
|
|
<TD ALIGN=CENTER NOSAVE><B>Figure 3: File Selection box for XFPovray
|
|
1.2.4</B></TD>
|
|
|
|
<TD ALIGN=CENTER NOSAVE><B>Figure 4: File Selection box for XFPovray
|
|
1.3.1</B></TD>
|
|
</TR>
|
|
</TABLE>
|
|
|
|
|
|
<P>The Scene File button only establishes the file which will be passed
|
|
to the renderer. It does't open the editor on that file. To
|
|
open the editor you next choose the Edit Scene button. Again, the
|
|
File Selection window opens. In the 1.3.1 version the default file
|
|
in this dialog is the file you chose with the Scene File button.
|
|
In the 1.2.4 version you start in whatever directory you started XFPovray
|
|
in originally. You can edit a file by clicking on it or use the dialog
|
|
to choose another file. Once you've selected a file the editor will
|
|
open into that file and your ready to do your work.
|
|
|
|
<P>The View Image button will simply launch an image viewer on a particular
|
|
image file. The Config File button will display the configuration
|
|
file used for POV-Ray (not for XFPovray). The settings for many of
|
|
these can be changed from Render Options (buttons in 1.2.4, a notebook
|
|
with tabs in 1.3.1), although there doesn't appear to be a way to save
|
|
the changes from the interface. If the defaults are not to your liking,
|
|
you can always edit the configuration file (xfpovray.ini) by hand.
|
|
|
|
<P>The rendering options cover a large number of POV-Ray options, but a
|
|
few options are not yet supported (see the web page for details on what
|
|
isn't supported). Figures 5 and 6 show the Rendering Options windows
|
|
for the two versions of XFPovray. Figure 6 was cropped from the main
|
|
window to save a little space. The render options in version 1.2.4
|
|
are displayed in the space occcupied by the povray banner image.
|
|
Figure 7 shows the tabs in the Render Options window for version 1.3.1.
|
|
As you can see, there are quite a few options you can configure from these
|
|
windows. Keep in mind that version 1.2.4 has the most of the same
|
|
options as 1.3.1, except with 1.2.4 you access them from a set of Render
|
|
Options buttons in the main window.
|
|
<BR>
|
|
<BR>
|
|
<TABLE BORDER=0 COLS=1 WIDTH="100%" NOSAVE >
|
|
<TR NOSAVE>
|
|
<TD ALIGN=CENTER NOSAVE><IMG SRC="./gx/hammel/xfpovray-5.jpg" HSPACE=10 VSPACE=10 HEIGHT=313 WIDTH=414></TD>
|
|
</TR>
|
|
|
|
<TR NOSAVE>
|
|
<TD ALIGN=CENTER NOSAVE><B>Figure 5: Render Options, version 1.2.4</B></TD>
|
|
</TR>
|
|
|
|
<TR NOSAVE>
|
|
<TD ALIGN=CENTER NOSAVE><IMG SRC="./gx/hammel/xfpovray-6.jpg" HSPACE=10 VSPACE=10 HEIGHT=400 WIDTH=428></TD>
|
|
</TR>
|
|
|
|
<TR NOSAVE>
|
|
<TD ALIGN=CENTER NOSAVE><B>Figure 6: Render Options, version 1.3.1</B></TD>
|
|
</TR>
|
|
</TABLE>
|
|
|
|
|
|
<P>Figures 7 and 8 show some of the possible templates you can use when
|
|
editing a scene file. Templates are examples of the various primitives
|
|
and command syntax you will use in a POV-Ray scene file. To use these
|
|
templates, you first select the template you want to add to your scene
|
|
file (we're assuming the scene file is already opened and currently being
|
|
edited). This copies the template to the primary X selection buffer.
|
|
This is the same buffer you use when you highlight some text in an xterm
|
|
window. To use the copy of the template you first enter insert mode
|
|
in your editor and then use the middle mouse button (or both buttons on
|
|
a 2 button mouse that is emulating a 3 button mouse) to paste the selection
|
|
into your file. Note that when you select the template from the menus
|
|
you won't see any sort of confirmation that the template has been placed
|
|
in the selection buffer.
|
|
<BR>
|
|
<BR>
|
|
<TABLE BORDER=0 COLS=1 WIDTH="100%" NOSAVE >
|
|
<TR NOSAVE>
|
|
<TD ALIGN=CENTER NOSAVE><IMG SRC="./gx/hammel/xfpovray-templates.jpg" HSPACE=10 VSPACE=10 HEIGHT=299 WIDTH=415></TD>
|
|
</TR>
|
|
|
|
<TR NOSAVE>
|
|
<TD ALIGN=CENTER NOSAVE><B>Figure 7: The solid primitive templates</B></TD>
|
|
</TR>
|
|
|
|
<TR NOSAVE>
|
|
<TD ALIGN=CENTER NOSAVE><IMG SRC="./gx/hammel/xfpovray-templates-2.jpg" HSPACE=10 VSPACE=10 HEIGHT=237 WIDTH=415></TD>
|
|
</TR>
|
|
|
|
<TR NOSAVE>
|
|
<TD ALIGN=CENTER NOSAVE><B>Figure 8: Camera primitve templates</B></TD>
|
|
</TR>
|
|
</TABLE>
|
|
|
|
|
|
<P>Once you've finished editing the file you can render a preview of the
|
|
image. Use the <I>Render Options/Output </I>feature to specify the
|
|
size of the preview. You can even use the <I>Inc Preview</I> button
|
|
to sample the effects provided by the standard include files! The
|
|
preview uses the selected texture, color, or whatever on a sphere.
|
|
You can specify the direction of lights and the camera position for the
|
|
preview as well. This makes selecting the features to add to an objects
|
|
texture much simpler and less error prone. Although there is still
|
|
a bit of trial an error involved with creating the textures, you can at
|
|
least sample some of the effects quickly and easily.
|
|
|
|
<P>One last thing you should know before trying XFPovray. I mentioned
|
|
earlier that I tried both the 1.2.4 and 1.3.1 versions. If you
|
|
run the earlier version first, then upgrade to the 1.3.1 version the program
|
|
seems to recognize the differences in the configuration files. However,
|
|
if you have problems with 1.3.1 and want to fall back to 1.2.4 you will
|
|
need to first clean out the files in the $HOME/.xfpovray directory.
|
|
The earlier version will get confused by the changes to the config files
|
|
that 1.3.1 uses. Its not a real concern, of course, if you don't
|
|
try to back track to from the later to the earlier version.
|
|
|
|
<P>All in all, XFPovray is quite a useful tool. When I was working
|
|
on my 3D text I first generated the include files of the text using Font3D/XFont3D.
|
|
After that, I was able to work completely from within XFPovray to sample
|
|
the images and experiment with minor changes quickly. I never had
|
|
to run the POV-Ray executable by hand, which was a real bonus since I never
|
|
can remember the correct command line options. If you do much work
|
|
with POV-Ray, I think you'll enjoy using XFPovray as your editing/rendering
|
|
front end.
|
|
<BR>
|
|
<TABLE WIDTH="100%" >
|
|
<TR>
|
|
<TD VALIGN=TOP COLSPAN="4" BGCOLOR="#000000" cellpadding="0" cellspacing="0"><IMG SRC="../gx/hammel/cleardot.gif" ALT="indent" ALIGN=LEFT></TD>
|
|
</TR>
|
|
</TABLE>
|
|
|
|
<TABLE WIDTH="100%" >
|
|
<TR>
|
|
<TD ALIGN=RIGHT><FONT SIZE=-2>© 1998 by <A HREF="mailto:mjhammel@csn.net">Michael
|
|
J. Hammel</A> </FONT></TD>
|
|
</TR>
|
|
</TABLE>
|
|
|
|
|
|
<!--===================================================================-->
|
|
<P> <hr> <P>
|
|
<center><H5>Copyright © 1998, Michael J. Hammel <BR>
|
|
Published in Issue 27 of <i>Linux Gazette</i>, April 1998</H5></center>
|
|
|
|
<!--===================================================================-->
|
|
<P> <hr> <P>
|
|
<A HREF="./gm.html"><IMG SRC="../gx/back2.gif"
|
|
ALT=" Back "></A>
|
|
<!--startcut ==========================================================-->
|
|
</BODY>
|
|
</HTML>
|
|
<!--endcut ============================================================-->
|