Site hosted by Angelfire.com: Build your free website today!

A3fEdit by Roughfish World Software

A Guide and Tutorial

A3fEdit allows you to create 3d models for use in our games. Download A3fEdit The window consists of a menu, menu buttons, action and view selection buttons, the drawing window and a view specific pane. There are 4 main actions Select, Add, Camera and Move. Select highlights the objects you want to work with. You can typically select by left clicking and draging a box around the objects or right clicking individual objects. Add will create a new object when you click the screen. Camera moves the virtual camera position without effecting the model. Move will change the geometry of the model.

There are also 4 views Vertex, Normal, Material and Bone. Vertex view allows you to build the wire frame and apply faces. Normal view lets you change the surface normals of the vertices for lighting effects. Material view creates the color and texture of the model. Bone view adds a bone structure and animations to the model.

Tutorial 1 - A Tree

Lets start your first model. Click on the ADD (plus sign) button and then click on the drawing window in three places to form a triangle. You will see them appear as dots of different colors. These colors have meaning which we will describe shortly. Then right click on the screen or press the F key. Now the vertices have been connected and form a face. Faces have direction and are culled so you only see them from one direction. Connecting vertices clockwise will create a face pointing toward you. The colors of the vertices indicate the order in which they were selected. Red was last, then green and blue. If your face is pointing the wrong way just click the rev (reverse) button in the view specific pane. Switch to the Normal view pane by using the menu or the button. Now switch your action to Camera by clicking the Camera (hand) button. Right click and drag the model and it will rotate. You can see the normals as little pink lines. If you want the normals calculated for you just click the Selected Normals button under Calculate Normals From. Now switch to Materials view. Make the triangle black by entering 0's in the Diffuse text boxes and then clicking OK. We will add a texture. Start up a paint program, draw a simple tree on a white background of 256 x 256 pixels (or some multiples of 64) and save it as a .bmp file. Click the Texture checkbox and then Browse. Select your tree image and click Open. You now see the image displayed behind your triangle face. If the face does not cover the tree image adjust the camera so it does. Use left SHIFT drag to adjust the zoom and left drag to position. When the face covers the tree click the From View button on the Material view pane. This grabs the texture coordinates from the screen for each selected vertex. You will now see 2 trees, the background image and a semi transparent image on the triangle face. This transparency is just to make it easier to work with the background image but we want to make our tree transparent for each white pixel. Select Luminance from the Alpha list box and click the OK button to the right. Do you notice there are 3 OK buttons! Make sure you select the one to the right and below. Click the File Save (disk) button and save your first model. Make sure the image file stays in the same folder as the .a3f file. You can read your .a3f file with any text editor. Here is the file we have created.

A3F
VERSION { 2.00 }
COMMENT { This file was generated by Roughfish World Software's A3FEdit. }
VERTICES { POSITION_NORMAL_TEXCOORDS 3
	-0.441406 0.515625 0.000000	0.000000 0.000000 1.000000	0.069290 0.227096
	0.511719 0.519531 0.000000	0.000000 0.000000 1.000000	0.877015 0.223786
	-0.015625 -0.664063 0.000000	0.000000 0.000000 1.000000	0.430118 1.000000
}
FACES { 1
	2 1 0	0
}
MATERIALS { 1
	MATERIAL { NAME default
		AMBIENT 0.200000 0.200000 0.200000 1.000000
		DIFFUSE 0.000000 0.000000 0.000000 1.000000
		EMISSION 0.000000 0.000000 0.000000 1.000000
		SPECULAR 0.000000 0.000000 0.000000 1.000000
		SHININESS 0
		TEXTURE {
			FILE tree.bmp
			ALPHA LUMINANCE
		}
	}
}
You can see there are 3 vertices, 1 face and 1 material. The vertex data is in the format: x y z nx ny nz tx ty, n=normal, t=texture
The face data has the three vertices in order of selection and one material.
The material has 4 color values each with red, green, blue, and alpha (opaqueness) values.
Ambient is not effected by lighting.
Diffuse is.
Emission is light cast off (but not implemented)
Specular is the phong highlight color.
Shininess effects the specular highlight.
And lastly our tree texture. An important note! Although you can have multiple materials they are not used in any of the games (for speed).

Tutorial 2 - A Spinning Ninja Star

Click File->New and switch to the Vertex view and the Add action. Left click on the drawing surface to create the five points of a star. Then left click in the center to add the last vertex. Now select from the menu Model->Vertices and Faces->Add Geometrics->Fan Faces. This will add faces facing the camera. You need to add the last face. Switch to the Select action and right click the vertices of the last remaining face clockwise and press the F key to add the face. Select just the center vertex by left clicking and dragging a box around it. Switch to the Camera action. Click the "l" button to rotate the camera to the left. Now switch to the Move action and Left click and drag the center vertex to the right. This has moved the vertex through the z axis. Click the Rotate (R) button located under the Action buttons. The default rotation is through Y by 90 degrees. The angles are in radians. 3.14 radians = 180 degrees. This is what we want so click OK. Make sure all the vertices are selected. You can click the menu Edit->Select All. Now click the Reflection button. It is the add geometric button with a picture of a reflection. You can also find this in the menu just like Fan Faces. This completes the vertices. Now switch to the Normal view and click Calculate Normals from Selected Vertices to recalculate the normals. Switch to Material view set the diffuse color to 8.0 4.0 2.0 1.0 for a gold color and click OK. Now we want to add the spinning animation. On the menu click Model->Has Bones. Now we can switch to the Bone view and switch to the Add action. Click in the middle of the drawing window to add a bone. Call it "root" and click OK. Select all the vertices to attach them to the root bone. Now click the Add (plus) Animation button and name it "spin" with 2 frames and 1 second total. Your input should look like this: spin 2 1.0
Drop down the Key Times listbox and select 0.000. Click the Add (plus) Key Time Bones button. Now you can select 1.000 from the Key Times and the "root" Key Bone from the list below. Switch the action to Move and right drag to rotate the model 72 degrees up. What you have just done is tell the animation engine to rotate the root bone (and attached vertices) 72 degrees in 1 second. Click the Run Animation button to set it in action. Later when you create more complex models with multiple bones and animations you will have vertices that are effected by more than one bone. This makes the skin deform smoothly. For instance you might make an arm with a wrist, elbow and shoulder bone. The vertices of the hand will attach to the wrist. The vertices of the wrist will attach to both the wrist and elbow bones. The vertices of the forearm will attach to the elbow. The vertices of the elbow will attach to both the elbow and shoulder bones and so on...

Hints and Tips

Keyboard Control

F - Add a face connecting the last three selected vertices
1,Q,A,Z - coorespond to Actions: Select, Add, Camera and Move
X,C,V,B - coorespond to Views: Vertex, Normal, Material, and Animation

Mouse Control

View
Mode
Mouse
Button
Action
Select
Action
Add
Action
Camera
Action
Move
VERTICES
AND FACES
LeftSelect Verts
and Faces
Add
Vertex
(X,Y)Move
Camera
(X,Y)Move
Vertices
Left
Shift
Select
More
(X,Z)Move
Camera
(X,Z)Move
Vertices
Left
Cntrl
Select
Less
Bubble
Vertices
RightSelect
Vertex
Add
Face
(X,Y)Rotate
Camera
(X,Y)Rotate
Vertices
Right
Shift
Select
Face
(X,Z)Rotate
Camera
(X,Z)Rotate
Vertices
Right
Cntrl
Clear
Selection
Zero
Camera
Twist
Vertices
NORMALS
AND DUPS
LeftSelect Verts
and Faces
(X,Y)Move
Camera
(X,Y)Point
Normals
Left
Shift
Select
More
(X,Z)Move
Camera
(X,Z)Point
Normals
Left
Cntrl
Select
Less
Bubble
Normals
RightSelect
Vertex
(X,Y)Rotate
Camera
(X,Y)Rotate
Normals
Right
Shift
Select
Face
(X,Z)Rotate
Camera
(X,Z)Rotate
Normals
Right
Cntrl
Clear
Selection
Zero
Camera
Twist
Normals
MATERIALS
AND TEXTURE
LeftSelect Verts
and Faces
(X,Y)Move
Camera
(X,Y)Move
TexCoords
Left
Shift
Select
More
(X,Z)Move
Camera
(X,Y)Move
Light
Left
Cntrl
Select
Less
RightSelect
Vertex
(X,Y)Rotate
Camera
Right
Shift
Select
Face
(X,Z)Rotate
Camera
Right
Cntrl
Clear
Selection
Zero
Camera
BONES
AND ANIMATION
LeftSelect
Vertices
Add
Bone
(X,Y)Move
Camera
(X,Y)Move
Bone
Left
Shift
Select
More
(X,Z)Move
Camera
(X,Z)Move
Bone
Left
Cntrl
Select
Less
RightSelect
Bone
(X,Y)Rotate
Camera
(X,Y)Rotate
Bone
Right
Shift
Select
Key Bone
(X,Z)Rotate
Camera
(X,Z)Rotate
Bone
Right
Cntrl
Clear
Selection
Zero
Camera
Reset
Key Bone

Limits

A3fEdit hasn't been fully tested outside of certain limits. These are:
Download A3fEdit