Will's VXL Editor by Will, 18 July 2000
Beta release 3 b

This release should be downloaded from:

http://www.gre.ac.uk/~sw694

Note to webmasters: you can link to this location, but be aware of mirroring- this release is bound to be out-of-date
by the time you do!

I don't promise this program will work properly on your machine.  Use at your own risk etc.
It works best on fast computers with high resolution hi-color (or better) displays.

*******************
* Your help in testing and commenting on this little program is greatly appreciated.
* Please give feedback!
*******************

THE 3D VIEW:
The 3D view has been overhauled.  It supports 3D spinning on all three axis.  Also, it scales the output as defined and editable in the Header Info dialog (under the View menu).

AIM SQUARE:
By popular demand, you can get a bounding box showing the extent of the voxels in each view, and a cross-hair to show the model centre.  This can be toggled on and off using the option under the View menu.

STATE OF NORMALS:
Normals are not strictly 'normals' in the sense usually associated with voxel graphics.  Rather than a vector, they store only angle and the Tiberian Sun engine seems to 'fudge' lighting affects.
The auto-normals tool is not especially advanced but does take a lot of the effort out of doing them manually.  You usually want to touch-up the normals manually for best effect however.
The smooth-normals tool is a major boon and can go some way to removing or lessening the jagged edges left by the auto-normals tool.  However, it doesn't do a perfect job and you need to see how the model looks in TS and return to the editor to touch the normals up manually.
These tools cannot deal well with flat angled sides when they are not are not at 90, 45 or 0 degrees- they may still appear like 'steps'.  You should set these a single normal value manually where you see this.

* Prompt if exiting without saving changes first!
Works most of the time..!

* Resizing and rescaling voxel models
You can now resize and rescale voxel models in the header info dialog (under the view menu).  The scaling information is defining the logical size on the screen to which your model will be scaled/stretched.  Experimentation is necessary to get this just right.  Also, the header as defined here is possibly not the latest understanding.  For better rescaling options run the 'vxlutil' program available from the xxc.tiberian.com website under third-party downloads.

* Nudging
You can now nudge your model in any direction one row at a time (under the tools menu).
(The text in these dialogs will be corrected next version!)

* The smooth-normals tool
Much like the 'soften' tools in Paint Shop Pro, only over the entire 3D skin of the model.  Run after the auto-normals tool for best effects.  Run several times to smooth more, as this tool is culmative.  You do get to a point after several runs however when the tool cannot smooth any more and you stop seeing a difference.  Your model may still need some touching-up manually though.

* The auto-normals tool
Much better than ever before, it can now deal better with sloping sides etc.  Your model may still need some touching-up manually though.
-> This tool will remove 'invisible' voxels which are hidden inside the model as this is necessary for it's logic.  Therefore, it is best to save your model before running this tool as a backup to return to, and to run this tool when you have finished colouring your model.

* Multiple Undo!
By popular demand, the tool incorporates an undo mechanism.  Use Edit | Undo (or [Ctrl]-Z) to undo your actions in order.  Most things support undo- editing, filling, flippping, clears etc.  Tools which don't will warn you first.
-> If you don't have a lot of RAM, or you are doing lots of flips and fills and other operations, there is a chance you
will run out of memory for the undo buffer (I can't get this to actually happen though).  The program will probably crash and you'll lose those edits.  So save regularly (this resets the undo buffer) or use the Edit | Enable Undo feature to stop the program remembering your actions.

* Flood Filling!
By popular demand, the tool incorporates a fill function.  On the keyboard, press the 'F' key.  You are now in fill mode (see the status bar).  Click on one of the 2D edit windows to apply a fill on that plane.  This can be undone.  If you press 'F' but do not want to do a fill, press the ESC key.

* 3D mode can show normals as well as colours, depending on the view mode.

* Better drawing
The 2D screens are draw faster and flicker less.

* You can 'get' the colour / normal of a voxel not immediately on your active plane (unless you are in slice mode!).

* Using the clear, flip and mirror tools:
You can speed-up creating completely new models; you need to base your voxel on an existing ts one in order to get the right header info etc, so load a ts voxel about the right size.  Then, use the Tools | Clear command to remove all the voxels and start with a blank page.  Now, most voxels are symetrical on the Y axis so there are some tools to help you:

-> Firstly, the clear Z tool removes a 'slice' across the model; useful if you want to clear a lot of the model but want to keep the tracks or turret ring or something.

-> Secondly, the flip X tool reverses the model along it's length, so that the front becomes the back and the back the front.  Useful if you drew your model back to front (guess why this was added..).

-> Thirdly, the flip Y tool reverses the model across the Y axis.  Useful if you want to mirror the the other side of the model.

-> More special, the mirror Y tool (under the Tools menu too) will take half the model and mirror it across the Y axis.  To visualise, if viewing the top view the lower half of the model will be mirrored across the window to fill the top half of the model too.  If you prefer to edit in the top half of the top-down view, flip Y before mirror.  This should majorly speed-up creating new units.

* New units
Modifying or creating new units is proving successful with this tool as it stands.  Units previously edited with alpha releases of this tool should be openned and resaved.

* Exit
The File | Exit button

Edit voxel files extracted using xcc.
Extracted palettes can be used too (the default is based upon unittem.pal)

Please take some time to read the Guide bundled with this editor.

==============================================================
KEYS
==============================================================

To add a voxel in the active colour, use the left mouse button.
To remove a voxel, use the right mouse button.

To undo an action, use the Edit | Undo or [Ctrl]-z key.

To change the plane you are editing, use the x, y, z and X, Y, Z keys.  Also, you can [shift]-left-click to 'jump' the planes to where you click.

To select the active colour, click with the left mouse button on the palette on the left of the screen.
To change the background colour, click with the right mouse button on the palette on the left of the screen.
To pickup the colour of the voxel underneath the mouse cursor, [shift]-right-click on it.

To do a colour-replace (if you want to completely recolour every voxel of one colour with another colour throughout the entire model automatically), first select the colour (using [Shift]-right-click or using the palette).  Now, on the palette, [Ctrl]-left-click the new palette entry.  All voxels of the old colour will now be automatically recoloured.

To fill an area, press the 'F' key to enter into fill mode.  Now click on a voxel within the target area in one of the 2D windows, or ESC to cancel the operation.  You can undo a fill action if you want to.

There are three view types available (under the View menu):
1) normal: all voxels from 0 to the plane limit are drawn
2) cross-section: like normal, except you can see (from the dotted borders) the voxels not on the active plane.
3) slice: only voxels on the current plane are drawn.

There are two view modes (under the View menu):
1) colours
2) normals; in normals mode, you can assign new normals to voxels as if you were painting them.

Colours are fairly obvious.  Some palette entries have special significance: those outlined in yellow are remappable, whereas palette entry 0 (also outlined in yellow) might indicate transparancy(?).  See xcc forum for discussions on palette entries for voxels.  When in colour mode, you can 'get' the colour of an existing voxel by [Shift]-right-clicking it.

Normals have a value of between -1 and 35 inclusive, the normal 'palette' lowest top.  -1 is coloured distinctively for development purposes (I believe it indicates that voxel should always be coloured black (see orca bomber canopy)).  When viewing in normal mode, you can 'get' the normal of an existing voxel by [Shift]-right-clicking it.

You can view the section header info (under the View menu); however, only the name can be modified.  note: the whole program is designed to only consider the first (#0) section within a voxel- not really an issue?

You cannot edit in the 3D view.  Use the scroll bars to rotate your 3D viewpoint.

Known issues:
* cannot create a new voxel.
* slow.

Feedback:
* if you have an error, what is it exactly?  error messages and circumstances useful.

Future:
* bug fixes
* load direct from mix file (but save to dir and use xcc to put into a mix..)
* create new

As usual, the underlying code is translated from xcc sourcecode into Delphi.  It mostly isn't
my invention and so I don't understand a lot of the concepts etc.  Credit to all those who
have contributed to xcc (especially Olaf), and to Dave (aka DMZ) for helping with the voxel file format.
And everyone who has been a keen tester!
