In this appendix some items that are related to Bullet Creator, but are beyond the scope of the manual, will be mentioned.
The Bullet Creator program uses only a small internal write cache when creating the image. Setting up a decent cache in your operating system can lead to a dramatic increase in speed when using Bullet Creator, especially when you are using texture mapped images. Without a disk read cache the reading of every single pixel data from disk takes more time than with a read cache which caches the image map in memory. In MS-DOS you can use smartdrv C+ to enable read- and write caching on drive C:.
My Windows95 configuration handles the cache pretty well: you can check if yours does too by running the program and see if the light of your harddisk goes bzerk or not. Check your Windows95 documentation to improve cache use if it does. Setting your System|Performance|File System to Network Server might do the trick.
Another way is to set up a RAMdrive and work in a directory on your RAMdrive. This is great if you've got some memory to use it on and want to create a whole lot of mapped bullets. I use a 24 Mb ramdrive when I want to change the background color of all the bullet images on this site in one go, using a batch file as explained in the next chapter.
If you have a lot of different bullet images you can use different .ini files and ray-trace them with one command using a simple dos batch file:
ren bc.ini bc_ini.bak
copy bullet01.ini bc.ini
bc203
del bc.ini
copy bullet02.ini bc.ini
bc203
del bc.ini
ren bc_ini.bak bc.ini
Execute this batch file to get the output files defined in bullet01.ini and bullet02.ini without having to wait until the first is done before starting with the other, but be sure that the input files all create an output file with a unique name.
So, if you want to do 12 images that all take 5 minutes to do, you don't have to get coffee 12 times but you can have lunch for an hour using this scripting method.
If you have a lot of different .ini files to create different bullet images, a very handy tool is BK ReplaceEm for Windows95. With this multi-file search and replace program you can change one of the lines in all your .ini files in one go, if you for example want to adjust the background color or glossiness factor for all bullets you use.
The color format used by Bullet Creator is a normalized RGB format, as used in VRML. HTML uses 2 byte Hex RGB format like #FFFFFF. To convert from this use the Colors Converter on the Javascripts page if your browser supports Javascript, or use a calculator like the scientific one in MS-Windows and follow this procedure:
For values of named colors see the page HTML colors.
Most graphic browsers support .gif and .jpg, but not .tga, so you'll have to convert the raw or tga files first to one of these two formats using a graphic format converter. My favorite for this task in Windows is Graph-X Viewer, a freeware program form Group 42 that deals with TGA, GIF, JPG and PNG, and has great dithering and a zoom function. For MS-DOS JPEG conversion and commandline/batch conversion see the next chapter.
WWW graphic formats
If you don't already have a program that can convert between TGA and JPG, or even if you have one, I recommend The Independent JPEG Group's JPEG software because the system requirements for that program are in the same league as Bullet Creator's, and it's freeware! These JPEG utilities can be used to convert the TGA output of Bullet Creator to JPEG images, or to convert JPEG images to TGA for texture mapping in Bullet Creator, or convert a .bmp to .jpg and then to .tga; see the documentation of jpeg6b for all the information. There are two versions for MS-DOS: jpeg6b.zip (187 kb.) for 286- systems and jpeg6b32.zip (285 kb.) for 386+ systems.
The following command is then used to convert the sample output of Bullet Creator into JPEG format:
cjpeg -quality 100 sample.tga
You can put these commands in the multi-bullet batch file to get your output in JPEG format in one go, and then delete the TGA output after that.
The batchfile can now be something like this if you've got cjpeg.exe in your Bullet Creator directory:
ren bc.ini bc_ini.bak
copy bullet01.ini bc.ini
bc203
cjpeg -quality 100 bullet01.tga
del bullet01.tga
del bc.ini
copy bullet02.ini bc.ini
bc203
cjpeg -quality 100 bullet02.tga
del bullet02.tga
del bc.ini
ren bc_ini.bak bc.ini
Instead of getting the output in the files bullet01.tga and bullet02.tga, you then get them in the JPEG format as bullet01.jpg and bullet02.jpg: ready for use in web-pages.
Why should I bother with integrating JPEG compression into Bullet Creator if it works as easy as this with external JPEG control? Now it's smart, small and smooth... not exactly how Bill Gates would do it!
Trick: If you choose the name of the outputfile the same as the name of the inputfile for a batchfile you can convert tga format output directly to jpeg by changing it to something like this:
@echo off
echo Starting Bullet Creator...
if "%1"=="" goto default
ren bc.ini bc.bak
copy %1 bc.ini
BC203
cjpeg -quality 100 %1
del bc.ini
ren bc.bak bc.ini
goto end
:default
BC203
goto end
:end
Now that you have a supported image file you can include it with the following tag in your HTML document:
<IMG alt="*" src="sample.jpg" width=50 height=50 align=top>
The ALT parameter defines the text that will be displayed in text browsers or when the image isn't loaded. The asterisk (*) is a good alternative for a bullet image.
For creating unordered lists with image bullets the images are used within tables. The basic procedure is that you create a table with two colums and a row for every unnumbered list item. In the cells of the first colum you put the bullet images, in the rest you put your list items. In this way the list items will not word-wrap under the bullets, just like in a regular unordered list. For indenting the list you can use three columns and leave the first one empty, as done in this example.
<TABLE BORDER=0 SUMMARY="Fancy unordered list with list-items in the third column">
<TR>
<TH ALIGN=LEFT COLSPAN=3>
The advanced unnumbered list:
<TR>
<TD width="50" ROWSPAN=3>
</TD>
<TD valign=top>
<IMG alt="*" src="li.jpg" width=15 height=15 align=top>
</TD>
<TD>
Item 1
<TR>
<TD valign=top>
<IMG alt="*" src="li.jpg" width=15 height=15 align=top>
</TD>
<TD>
Item 2
<TR>
<TD valign=top>
<IMG alt="*" src="li.jpg" width=15 height=15 align=top>
</TD>
<TD>
Item 3
</TABLE>
This HTML code will give the following result:
The advanced unnumbered list: | ||
---|---|---|
Item 1 | ||
Item 2 | ||
Item 3 |
Numbered lists can of course be made by using bullets with images of numbers mapped onto them.
According to the CSS recommendation it will be much easier to put the bullets where you want them. When you use Cascading Style Sheets (CSS) you can specify the following in your style sheet to use ./images/li.jpg as bullets:
UL { list-style-image: url(./images/li.jpg) }
Internet Explorer 5 can handle this construct, but other browsers may vary.
You don't need a fancy map editor to create client side image maps to use with your bullets. The only area shape you will have to use is the circle. For a circle a specification of the two coordinates of the centre and a value for the radius is needed, which are very easy to get for a bullet. The centre of the circle shape is also the centre of the image, so just devide the size of the image by two. This value is the value of the first two numbers in the coordinate section of the area shape. The radius is the size of the image devided by twice the zoom factor.
If you don't get it and have a Javascript friendly browser, try the Coords Calculator on the Javascripts page. If you used the autozoom function, first calculate the actual zoom factor with the Javascript Auto Zoom calculator also on that page.
The following code defines a clickable map:
<MAP name="Bcmap">
<AREA SHAPE="circle" COORDS="25,25,15" HREF="#Maps">
</MAP>
<IMG src="../images/sample.jpg" width="50" height="50" alt="Clickable Map" USEMAP="#Bcmap" ISMAP BORDER=0>
And gives the following result:
On systems with less than 24-bit color depth the images can appear different than intended. On 24-bit graphic systems everything should look as it is supposed to. Different browsers do different dithering qualities. Netscape 4.0 does it better than 3.0 in 8-bit color modus. NCSA Mosaic for Windows 3.0 is even worse in 8-bit color modus.
Alan Watt, 3D Computer Graphics, Addison-Wesley, ISBN 0-201-63186-5