Changes between Version 4 and Version 5 of Basic3DImplementation


Ignore:
Timestamp:
Jul 1, 2012, 4:07:42 AM (12 years ago)
Author:
historic_bruno
Comment:

Change XML images to code blocks for copy-pasting. Adds some links. Cleans up formatting.

Legend:

Unmodified
Added
Removed
Modified
  • Basic3DImplementation

    v4 v5  
    1010== Actor file setup ==
    1111
    12 [[BR]]Lets begin by creating an 'actor' xml file that will link our 3D model with the texture file and crucially make them visible in Atlas (0 A.D.'s Map/Scenario Editor).
     12[[BR]]Lets begin by creating an [wiki:Actors actor] XML file that will link our 3D model with the texture file and crucially make them visible in [wiki:Atlas_Manual Atlas] (0 A.D.'s !Map/Scenario Editor).
    1313
    14  * '''STEP 1 -''' Navigate to the 'mods' folder in the game's installation directory: binaries\data\mods
     14 * '''STEP 1 -''' Navigate to the 'mods' folder in the game's installation directory: `binaries\data\mods` (see [wiki:Mod_Layout mod layout] for details)
    1515
    1616 * '''STEP 2 -''' In the mods folder you will have a 'public.zip' file that needs to be extracted into a folder also called 'public' within the 'mods' folder.
    1717
    18  * '''STEP 3 -''' Once the public zip is extracted, navigate to the following folder: binaries\data\mods\public\art\actors\props\special\eyecandy
     18 * '''STEP 3 -''' Once the public zip is extracted, navigate to the following folder: `binaries\data\mods\public\art\actors\props\special\eyecandy`
    1919
    2020 * '''STEP 4 -''' Make a duplicate of the actor file called 'crate_a.xml' and call it 'crate_test.xml'
    2121
    2222 * '''STEP 5 -''' Open the 'crate_test.xml' file in Notepad ++ (or any code editor). You will see this:[[BR]]
    23  [[Image(http://i173.photobucket.com/albums/w73/purepics/0AD/actoropen.gif)]][[BR]]
    24  (Ignore the colored highlighted areas in this screenshot, that happens by default in Notepad++)[[BR]]
     23{{{
     24#!xml
     25<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
     26<actor version="1">
     27
     28  <castshadow/>
     29
     30  <group>
     31    <variant frequency="100" name="Base">
     32      <mesh>props/wrld_crate_a.dae</mesh>
     33      <texture>props/celt_prop_1.dds</texture>
     34    </variant>
     35  </group>
     36
     37</actor>
     38}}}
    2539
    2640 * '''STEP 6 -''' We need to change the file locations for 'mesh' and 'texture' to these:[[BR]]
    27  <mesh>props/wrld_crate_test.dae</mesh>[[BR]]
    28  <texture>props/crate_test.png</texture>[[BR]]
     41 `<mesh>props/wrld_crate_test.dae</mesh>`[[BR]]
     42 `<texture>props/crate_test.png</texture>`[[BR]]
    2943 [[BR]]The code should now look like this:[[BR]]
    30  [[Image(http://i173.photobucket.com/albums/w73/purepics/0AD/actorchanged.gif)]][[BR]]
     44{{{
     45#!xml
     46<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
     47<actor version="1">
     48
     49  <castshadow/>
     50
     51  <group>
     52    <variant frequency="100" name="Base">
     53      <mesh>props/wrld_crate_test.dae</mesh>
     54      <texture>props/crate_test.png</texture>
     55    </variant>
     56  </group>
     57
     58</actor>
     59}}}
    3160
    3261 * '''STEP 7 -''' Save the file (as 'crate_test.xml') and close Notepad ++
     
    4473 
    4574 Open the texture file in Gimp by going to File > Open... and then selecting the image downloaded from burningwell.org. Once opened the editing window should look like this:[[BR]]
     75
    4676 [[Image(http://i173.photobucket.com/albums/w73/purepics/0AD/textureopened.gif)]][[BR]]
    4777 
    48  * '''STEP 4 -''' Now we are going to resize the texture so that it is 128x128 pixels. To do this, go to Image > Scale Image and change the Height value to 128 pixels. Make sure the Height and Width dimensions are locked (this changes the width value to 171px) like in the image below:[[BR]]
     78 * '''STEP 4 -''' Now we are going to resize the texture so that it is 128x128 pixels. To do this, go to '''Image > Scale Image''' and change the Height value to 128 pixels. Make sure the Height and Width dimensions are locked (this changes the width value to 171px) like in the image below:[[BR]]
    4979 
    5080 [[Image(http://i173.photobucket.com/albums/w73/purepics/0AD/texturescale.gif)]][[BR]]
    5181 Select 'Scale' button to perform the scale[[BR]]
    5282 
    53  * '''STEP 5 -''' We're now going to edit the canvas to make the texture 128x128. Go to Image > Canvas Size... and there change the Width to 128px. The Offset can also be set similar to how I've done it below:
     83 * '''STEP 5 -''' We're now going to edit the canvas to make the texture 128x128. Go to '''Image > Canvas Size...''' and there change the Width to 128px. The Offset can also be set similar to how I've done it below:[[BR]]
     84
    5485 [[Image(http://i173.photobucket.com/albums/w73/purepics/0AD/texturecanvas.gif)]][[BR]]
    5586 
    5687 Select 'Resize' button to perform the resize to 128x128[[BR]]
    5788 
    58  * '''STEP 6 -''' Now we're going to save a PNG file called 'crate_test.png'. Go to File > Export... and select the 'PNG image (*.png)' fileformat in the dropdown. Make the Name 'crate_test.png' and then select 'Export' to save the file. Make a note of where you saved the file for the next step.
     89 * '''STEP 6 -''' Now we're going to save a PNG file called 'crate_test.png'. Go to '''File > Export...''' and select the 'PNG image (*.png)' fileformat in the dropdown. Make the Name 'crate_test.png' and then select 'Export' to save the file. Make a note of where you saved the file for the next step.
    5990
    60  * '''STEP 7 -''' Move the PNG file to the following location: binaries\data\mods\public\art\textures\skins\props
     91 * '''STEP 7 -''' Move the PNG file to the following location: `binaries\data\mods\public\art\textures\skins\props` (see [wiki:Mod_Layout mod layout] for details)
    6192
    6293 
     
    6899 * '''STEP 1 -''' Open Blender (the latest version of Blender is always recommended)
    69100
    70  * '''STEP 2 -''' We're going to use the cube that appears by default in Blenders 3D View window[[BR]]
     101 * '''STEP 2 -''' We're going to use the cube that appears by default in Blenders 3D View window:[[BR]]
    71102 
    72103 [[Image(http://i173.photobucket.com/albums/w73/purepics/0AD/blenderstart.gif)]][[BR]]
    73104 
    74  The first thing we're therefore going to do is change from  'Object Mode' to 'Edit Mode'[[BR]]
     105 The first thing we're therefore going to do is change from  'Object Mode' to 'Edit Mode':[[BR]]
    75106 
    76107 [[Image(http://i173.photobucket.com/albums/w73/purepics/0AD/blendereditmode.gif)]][[BR]]
    77108 
    78  * '''STEP 3 -''' Once in edit mode go to Mesh > UV Unwrap... > Unwrap[[BR]]
     109 * '''STEP 3 -''' Once in edit mode go to '''Mesh > UV Unwrap... > Unwrap''':[[BR]]
    79110 
    80111 [[Image(http://i173.photobucket.com/albums/w73/purepics/0AD/blenderuvunwrap.gif)]][[BR]]
    81112
    82  * '''STEP 4 -''' Surprisingly that's all we need to do in this very simple example. So now we can export the 3D model file by going back into 'Object Mode', selecting the cube, and going to File > Export > COLLADA (.dae)[[BR]]
     113 * '''STEP 4 -''' Surprisingly that's all we need to do in this very simple example. So now we can export the 3D model file by going back into 'Object Mode', selecting the cube, and going to '''File > Export > COLLADA (.dae)''':[[BR]]
    83114 
    84115 [[Image(http://i173.photobucket.com/albums/w73/purepics/0AD/blenderexport.gif)]][[BR]]
    85116 
    86  * '''STEP 5 -''' In the export window that opens up, select 'Export only selected'[[BR]]
     117 * '''STEP 5 -''' In the export window that opens up, select 'Export only selected':[[BR]]
     118
    87119 [[Image(http://i173.photobucket.com/albums/w73/purepics/0AD/blenderselectedonly.gif)]][[BR]]
    88120 
    89  * '''STEP 6 -''' Change the filename to wrld_crate_test.dae and then click 'Export COLLADA'[[BR]]
     121 * '''STEP 6 -''' Change the filename to wrld_crate_test.dae and then click 'Export COLLADA':[[BR]]
     122
    90123 [[Image(http://i173.photobucket.com/albums/w73/purepics/0AD/blendersave.gif)]][[BR]]
    91124 
    92  * '''STEP 7 -''' Move the DAE file to the following location: binaries\data\mods\public\art\meshes\props
     125 * '''STEP 7 -''' Move the DAE file to the following location: `binaries\data\mods\public\art\meshes\props` (see [wiki:Mod_Layout mod layout] for details)
    93126
    94127[[BR]]
    95128== Viewing model in Atlas ==
    96129
    97 [[BR]]After saving the actor file, creating the texture, and exporting the 3D model, we can now open 0 A.D.'s Atlas Editor to view the crate in-game
     130[[BR]]After saving the actor file, creating the texture, and exporting the 3D model, we can now open 0 A.D.'s [wiki:Atlas_Manual Atlas Editor] to view the crate in-game
    98131
    99  * '''STEP 1 -''' Run 0 A.D. and in the menu select Tools & Options > Scenario Editor[[BR]]
     132 * '''STEP 1 -''' Run 0 A.D. and in the menu select '''Tools & Options > Scenario Editor''':[[BR]]
     133
    100134 [[Image(http://i173.photobucket.com/albums/w73/purepics/0AD/scenarioeditor.gif)]][[BR]]
    101135
    102  * '''STEP 2 -''' Select the 'Object' tab[[BR]]
     136 * '''STEP 2 -''' Select the [wiki:Atlas_Manual_Object_Tab Object tab]:[[BR]]
     137
    103138 [[Image(http://i173.photobucket.com/albums/w73/purepics/0AD/atlasobject.gif)]][[BR]]
    104139 
    105  * '''STEP 3 -''' Select Actors(All) in the dropdown to view actor objects instead of entities (that require additional templating)[[BR]]
     140 * '''STEP 3 -''' Select Actors(All) in the dropdown to view actor objects instead of [wiki:Entity entities] (that requires additional templating):[[BR]]
     141
    106142 [[Image(http://i173.photobucket.com/albums/w73/purepics/0AD/atlasactorsallt.gif)]][[BR]]
    107143 
    108  * '''STEP 4 -''' In the Filter field type 'crate_test' to find the actor file we created earlier[[BR]]
     144 * '''STEP 4 -''' In the Filter field type 'crate_test' to find the actor file we created earlier:[[BR]]
     145
    109146 [[Image(http://i173.photobucket.com/albums/w73/purepics/0AD/atlasfilter.gif)]][[BR]]
    110147 
    111  * '''STEP 5 -''' Select the actor file in the list, and then click on 'Switch to Actor Viewer' to view the object in 'Actor Viewer'[[BR]]
     148 * '''STEP 5 -''' Select the actor file in the list, and then click on 'Switch to Actor Viewer' to view the object in [wiki:Atlas_Manual_Object_Tab#TheActorViewer Actor Viewer]:[[BR]]
     149
    112150 [[Image(http://i173.photobucket.com/albums/w73/purepics/0AD/atlasactorviewer.gif)]][[BR]]
    113151 
    114152 * '''STEP 6 -''' The finished object should look like this in Actor Viewer:[[BR]]
     153
    115154 [[Image(http://i173.photobucket.com/albums/w73/purepics/0AD/atlasfinal.gif)]][[BR]]