Changes between Version 7 and Version 8 of ArtDesignDocument
- Timestamp:
- Jan 7, 2009, 3:14:37 AM (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
ArtDesignDocument
v7 v8 354 354 ||'''Step 1 - Attaching'''[[BR]][[BR]] [[BR]][[BR]]The next step is to select the structure and attach all [[BR]] the props:[[BR]]'''[[Image(http://www.wildfiregames.com/0ad/images/artspec/image011.gif)]]'''[[BR]][[BR]][[BR]][[BR]] [[BR]][[BR]] [[BR]][[BR]]You will see the following menu pop up, just hit OK.[[BR]][[BR]] [[BR]]'''[[Image(http://www.wildfiregames.com/0ad/images/artspec/image012.gif)]]'''||'''Step 2 - Pivot Placement'''[[BR]][[BR]] [[BR]][[BR]]Now, all your props will be included in one object. We [[BR]] next should move our object to the centre of the 3dsmax world. In order to do that we need to make sure our pivot point is in the correct location.[[BR]][[BR]]'''[[Image(http://www.wildfiregames.com/0ad/images/artspec/image013.gif)]]'''[[BR]][[BR]][[BR]]Click on the hierarchy tab, then click the pivot button, then the "Affect Pivot Only" button.[[BR]][[BR]]'''[[Image(http://www.wildfiregames.com/0ad/images/artspec/image014.gif)]]'''[[BR]][[BR]][[BR]]Centre your pivot (X,Y) to the centre of your structure (or where you want it to be anchored in the game).[[BR]][[BR]]'''[[Image(http://www.wildfiregames.com/0ad/images/artspec/image015.gif)]]'''[[BR]][[BR]][[BR]]The Z is a bit different; we want to position this to the bottom of the structure. If we put it in the middle, then your structure would be 'buried' halfway in the game's terrain. Not good.[[BR]][[BR]]'''[[Image(http://www.wildfiregames.com/0ad/images/artspec/image016.gif)]]'''[[BR]][[BR]][[BR]]Ok, you're now done moving your pivot. Turn off the 'Affect Pivot Only' button.|| 355 355 356 ||'''Step 3 - Detaching'''[[BR]][[BR]] [[BR]][[BR]]Now, let's move our structure to the centre of the world. You can do this by just inputting zeros in the world coordinates at the bottom of the screen.[[BR]][[BR]]'''[[Image(http://www.wildfiregames.com/0ad/images/artspec/image017.gif)]]'''[[BR]][[BR]][[BR]]'''[[Image(http://www.wildfiregames.com/0ad/images/artspec/image018.gif)]]'''[[BR]][[BR]]The next step is to separate the props again from the object. So first we select all the prop objects like this image to the left.[[BR]][[BR]] Then we detach them.[[BR]][[BR]]'''[[Image(http://www.wildfiregames.com/0ad/images/artspec/image019.gif)]]'''[[BR]][[BR]][[BR]]A new window will pop up.[[BR]][[BR]]'''[[Image(http://www.wildfiregames.com/0ad/images/artspec/image020.gif)]]'''[[BR]][[BR]][[BR]]I'm going to go ahead and properly name it right here.[[BR]][[BR]] While I'm at it, I'll go ahead and properly name the structure too.[[BR]][[BR]]'''[[Image(http://www.wildfiregames.com/0ad/images/artspec/image021.gif)]]''' [[BR]]||'''Step 4 - Setting the Prop Point'''[[BR]][[BR]] [[BR]][[BR]]Now, it's time to work with the prop point. First, we need to create one.[[BR]][[BR]]'''[[Image(http://www.wildfiregames.com/0ad/images/artspec/image022.gif)]]'''[[BR]][[BR]][[BR]]Click on the 'create' tab, then the helper object button, [[BR]] then scroll down and you will see a choice of 'PS Helpers'. Select that.[[BR]][[BR]]'''[[Image(http://www.wildfiregames.com/0ad/images/artspec/image023.gif)]]'''[[BR]][[BR]][[BR]]Now our prop tab looks a bit different. Go ahead and place a prop point. Once you place it, it will look like this:[[BR]][[BR]]'''[[Image(http://www.wildfiregames.com/0ad/images/artspec/image024.gif)]]'''||356 ||'''Step 3 - Detaching'''[[BR]][[BR]] [[BR]][[BR]]Now, let's move our structure to the centre of the world. You can do this by just inputting zeros in the world coordinates at the bottom of the screen.[[BR]][[BR]]'''[[Image(http://www.wildfiregames.com/0ad/images/artspec/image017.gif)]]'''[[BR]][[BR]][[BR]]'''[[Image(http://www.wildfiregames.com/0ad/images/artspec/image018.gif)]]'''[[BR]][[BR]]The next step is to separate the props again from the object. So first we select all the prop objects like this image to the left.[[BR]][[BR]] Then we detach them.[[BR]][[BR]]'''[[Image(http://www.wildfiregames.com/0ad/images/artspec/image019.gif)]]'''[[BR]][[BR]][[BR]]A new window will pop up.[[BR]][[BR]]'''[[Image(http://www.wildfiregames.com/0ad/images/artspec/image020.gif)]]'''[[BR]][[BR]][[BR]]I'm going to go ahead and properly name it right here.[[BR]][[BR]] While I'm at it, I'll go ahead and properly name the structure too.[[BR]][[BR]]'''[[Image(http://www.wildfiregames.com/0ad/images/artspec/image021.gif)]]'''||'''Step 4 - Setting the Prop Point'''[[BR]][[BR]] [[BR]][[BR]]Now, it's time to work with the prop point. First, we need to create one.[[BR]][[BR]]'''[[Image(http://www.wildfiregames.com/0ad/images/artspec/image022.gif)]]'''[[BR]][[BR]][[BR]]Click on the 'create' tab, then the helper object button, [[BR]] then scroll down and you will see a choice of 'PS Helpers'. Select that.[[BR]][[BR]]'''[[Image(http://www.wildfiregames.com/0ad/images/artspec/image023.gif)]]'''[[BR]][[BR]][[BR]]Now our prop tab looks a bit different. Go ahead and place a prop point. Once you place it, it will look like this:[[BR]][[BR]]'''[[Image(http://www.wildfiregames.com/0ad/images/artspec/image024.gif)]]'''|| 357 357 358 358 ||'''Step 5 - Exporting'''[[BR]][[BR]] [[BR]][[BR]]It is time to export! select both the prop point and the [[BR]] structure.[[BR]][[BR]]'''[[Image(http://www.wildfiregames.com/0ad/images/artspec/image025.gif)]]'''[[BR]][[BR]] [[BR]][[BR]]Go to File => Export Selected[[BR]][[BR]]'''[[Image(http://www.wildfiregames.com/0ad/images/artspec/image026.gif)]]'''[[BR]][[BR]] [[BR]][[BR]]Now go ahead and export your structure.[[BR]][[BR]]'''[[Image(http://www.wildfiregames.com/0ad/images/artspec/image027.gif)]]'''[[BR]][[BR]] [[BR]][[BR]]And that's it! You just exported an object with a prop point included! Repeat the same export for the prop point.||'''Step 6 - xml code'''[[BR]][[BR]] [[BR]][[BR]]You're all done in 3dmax. Now it is time to look at the [[BR]] xml code.[[BR]][[BR]]'''[[Image(http://www.wildfiregames.com/0ad/images/artspec/image028.gif)]]'''[[BR]][[BR]][[BR]][[BR]] [[BR]][[BR]]In this code snippet:[[BR]][[BR]] [[BR]][[BR]]We have given it the proper name (the name that will appear in Atlas). We are also pointing to the newly created *.pmd file. We call up the texture.[[BR]][[BR]]We name the prop point and tell it what actor is supposed to go there.[[BR]][[BR]] [[BR]]'''[[Image(http://www.wildfiregames.com/0ad/images/artspec/image029.gif)]]'''[[BR]][[BR]][[BR]] [[BR]][[BR]]In this code snippet:[[BR]][[BR]] [[BR]][[BR]]We have given it the proper name (that will be 'called up' by the code above). We are also pointing to the newly created PMD file. We call up the texture.[[BR]][[BR]] [[BR]][[BR]]'''Summary'''[[BR]][[BR]] [[BR]][[BR]]The tutorial above probably has some unneeded steps, but for the beginner, this is a good way to start. You will find yourself refining your procedures with experience.|| … … 795 795 DATA 796 796 797 ╚MODS 798 799 ╚OFFICIAL 800 801 ╚ART 802 803 ╠'''ACTORS''' 804 805 ║ ╠FAUNA 806 807 ║ ╠FLORA 808 809 ║ ╠GEOLOGY 810 811 ║ ╠PROPS 812 813 ║ ║ ╠FAUNA 814 815 ║ ║ ╠FLORA 816 817 ║ ║ ╠GEOLOGY 818 819 ║ ║ ╠STRUCTURES 820 821 ║ ║ ╠TEMP 822 823 ║ ║ ╚UNITS 824 825 ║ ╠STRUCTURES 826 827 ║ ╠TEMP 828 829 ║ ╚UNITS 830 831 ╠'''ANIMATION''' 832 833 ║ ╠BIPED 834 835 ║ ╠GAIA 836 837 ║ ╠MECHANICAL 838 839 ║ ╠QUADRAPED 840 841 ║ ╚SIMPLE 842 843 ╠'''MATERIALS''' 844 845 ╠'''MESHES''' 846 847 ║ ╠GAIA 848 849 ║ ╠PROPS 850 851 ║ ╠SKELETAL 852 853 ║ ╠STRUCTURAL 854 855 ║ ╠TEMP 856 857 ║ ╚TEST 858 859 ╠'''SKELETONS''' 860 861 ╚'''TEXTURES''' 862 863 ╠ANIMATED 864 865 ╠CURSORS 866 867 ╠PARTICLES 868 869 ╠SKIES 870 871 ╠SKINS 872 873 ║ ╠GAIA 874 875 ║ ╠PROPS 876 877 ║ ╠SKELETAL 878 879 ║ ╠STRUCTURAL 880 881 ║ ╠TEMP 882 883 ║ ╚TEST 884 885 ╠TERRAIN 886 887 ║ ╠ALPHAMAPS 888 889 ║ ╚TYPES 890 891 ╚UI 892 797 ╚MODS 798 799 ╚OFFICIAL 800 801 ╚ART 802 803 ╠'''ACTORS''' 804 805 ║ ╠FAUNA 806 807 ║ ╠FLORA 808 809 ║ ╠GEOLOGY 810 811 ║ ╠PROPS 812 813 ║ ║ ╠FAUNA 814 815 ║ ║ ╠FLORA 816 817 ║ ║ ╠GEOLOGY 818 819 ║ ║ ╠STRUCTURES 820 821 ║ ║ ╠TEMP 822 823 ║ ║ ╚UNITS 824 825 ║ ╠STRUCTURES 826 827 ║ ╠TEMP 828 829 ║ ╚UNITS 830 831 ╠'''ANIMATION''' 832 833 ║ ╠BIPED 834 835 ║ ╠GAIA 836 837 ║ ╠MECHANICAL 838 839 ║ ╠QUADRAPED 840 841 ║ ╚SIMPLE 842 843 ╠'''MATERIALS''' 844 845 ╠'''MESHES''' 846 847 ║ ╠GAIA 848 849 ║ ╠PROPS 850 851 ║ ╠SKELETAL 852 853 ║ ╠STRUCTURAL 854 855 ║ ╠TEMP 856 857 ║ ╚TEST 858 859 ╠'''SKELETONS''' 860 861 ╚'''TEXTURES''' 862 863 ╠ANIMATED 864 865 ╠CURSORS 866 867 ╠PARTICLES 868 869 ╠SKIES 870 871 ╠SKINS 872 873 ║ ╠GAIA 874 875 ║ ╠PROPS 876 877 ║ ╠SKELETAL 878 879 ║ ╠STRUCTURAL 880 881 ║ ╠TEMP 882 883 ║ ╚TEST 884 885 ╠TERRAIN 886 887 ║ ╠ALPHAMAPS 888 889 ║ ╚TYPES 890 891 ╚UI 893 892 894 893 = [ Appendix A] = … … 900 899 {{{ 901 900 PMD { 902 }}} 903 {{{ 904 char magic[4]; // == "PSMD" 905 }}} 906 {{{ 907 u32 version; // == 3 908 }}} 909 {{{ 910 u32 data_size; // == filesize-12 911 }}} 912 {{{ 913 914 }}} 915 {{{ 916 u32 numVertices; 917 }}} 918 {{{ 919 Vertex vertices[numVertices]; 920 }}} 921 {{{ 922 923 }}} 924 {{{ 925 u32 numFaces; 926 }}} 927 {{{ 928 Face faces[numFaces]; 929 }}} 930 {{{ 931 932 }}} 933 {{{ 934 u32 numBones; 935 }}} 936 {{{ 937 BoneState restStates[numBones]; 938 }}} 939 {{{ 940 941 }}} 942 {{{ 943 u32 numPropPoints; 944 }}} 945 {{{ 946 PropPoint propPoints[numPropPoints]; // note: PropPoint has variable size (see below) 947 }}} 948 {{{ 901 char magic[4]; // == "PSMD" 902 u32 version; // == 3 903 u32 data_size; // == filesize-12 904 905 u32 numVertices; 906 Vertex vertices[numVertices]; 907 908 u32 numFaces; 909 Face faces[numFaces]; 910 911 u32 numBones; 912 BoneState restStates[numBones]; 913 914 u32 numPropPoints; 915 PropPoint propPoints[numPropPoints]; // note: PropPoint has variable size (see below) 949 916 } 950 }}} 951 {{{ 952 953 }}} 954 {{{ 917 955 918 Vertex { 956 }}} 957 {{{ 958 Vector3D position; // in world space, matching the restStates pose 959 }}} 960 {{{ 961 Vector3D normal; 962 }}} 963 {{{ 964 float u, v; 965 }}} 966 {{{ 967 VertexBlend blend; 968 }}} 969 {{{ 919 Vector3D position; // in world space, matching the restStates pose 920 Vector3D normal; 921 float u, v; 922 VertexBlend blend; 970 923 } 971 }}} 972 {{{ 973 974 }}} 975 {{{ 976 VertexBlend { // represents the set of bones affecting a vertex 977 }}} 978 {{{ 979 u8 bones[4]; // bone indices; 0xFF in any position indicates "no bone" for vertices with fewer than 4 bones 980 }}} 981 {{{ 982 float weights[4]; // add up to 1.0 (0 is used for unused bones) 983 }}} 984 {{{ 924 925 VertexBlend { // represents the set of bones affecting a vertex 926 u8 bones[4]; // bone indices; 0xFF in any position indicates "no bone" for vertices with fewer than 4 bones 927 float weights[4]; // add up to 1.0 (0 is used for unused bones) 985 928 } 986 }}} 987 {{{ 988 989 }}} 990 {{{ 929 991 930 Face { 992 }}} 993 {{{ 994 u16 vertices[3]; // vertex indices; all faces are triangles 995 }}} 996 {{{ 931 u16 vertices[3]; // vertex indices; all faces are triangles 997 932 } 998 }}} 999 {{{ 1000 1001 }}} 1002 {{{ 933 1003 934 BoneState { 1004 }}} 1005 {{{ 1006 Vector3D translation; 1007 }}} 1008 {{{ 1009 Quaternion rotation; 1010 }}} 1011 {{{ 1012 1013 }}} 1014 {{{ 1015 // the bone's final transform matrix is translation * rotation 1016 }}} 1017 {{{ 935 Vector3D translation; 936 Quaternion rotation; 937 938 // the bone's final transform matrix is translation * rotation 1018 939 } 1019 }}} 1020 {{{ 1021 1022 }}} 1023 {{{ 940 1024 941 PropPoint { 1025 }}} 1026 {{{ 1027 u32 nameLength; 1028 }}} 1029 {{{ 1030 char name[nameLength]; 1031 }}} 1032 {{{ 942 u32 nameLength; 943 char name[nameLength]; 1033 944 1034 }}} 1035 {{{ 1036 Vector3D translation; 1037 }}} 1038 {{{ 1039 Quaternion rotation; 1040 }}} 1041 {{{ 1042 1043 }}} 1044 {{{ 1045 u8 bone; 1046 }}} 1047 {{{ 1048 1049 }}} 1050 {{{ 1051 // the prop point's final transform matrix is boneTransform * translation * rotation, 1052 }}} 1053 {{{ 1054 // where boneTransform is that of the given bone or identity if no bones are used 1055 }}} 1056 {{{ 945 Vector3D translation; 946 Quaternion rotation; 947 948 u8 bone; 949 950 // the prop point's final transform matrix is boneTransform * translation * rotation, 951 // where boneTransform is that of the given bone or identity if no bones are used 1057 952 } 1058 }}} 1059 {{{ 1060 1061 }}} 1062 {{{ 953 1063 954 Vector3D { 1064 }}} 1065 {{{ 1066 float x, y, z; 1067 }}} 1068 {{{ 955 float x, y, z; 1069 956 } 1070 }}} 1071 {{{ 1072 1073 }}} 1074 {{{ 957 1075 958 Quaternion { 1076 }}} 1077 {{{ 1078 float x, y, z, w; 1079 }}} 1080 {{{ 959 float x, y, z, w; 1081 960 } 1082 961 }}} … … 1089 968 {{{ 1090 969 pos = (0,0,0) 970 norm = (0,0,0) 971 for i = 0 to 3: 972 if blend.bones[i] != 0xFF: 973 inverseRestMatrix = (restStates[blend.bones[i]].translation * restStates[blend.bones[i]].rotation) ^ -1 974 animatedPoseMatrix = animatedBoneStates[blend.bones[i]].translation * animatedBoneStates[blend.bones[i]].rotation 975 pos += blend.weights[i] * animatedPoseMatrix * inverseRestMatrix * (position,1) 976 norm += blend.weights[i] * animatedPoseMatrix * inverseRestMatrix * (normal,0) 977 norm = normalise(norm) 978 1091 979 }}} 1092 {{{1093 norm = (0,0,0)1094 }}}1095 {{{1096 for i = 0 to 3:1097 }}}1098 {{{1099 if blend.bones[i] != 0xFF:1100 }}}1101 {{{1102 inverseRestMatrix = (restStates[blend.bones[i]].translation * restStates[blend.bones[i]].rotation) ^ -11103 }}}1104 {{{1105 animatedPoseMatrix = animatedBoneStates[blend.bones[i]].translation * animatedBoneStates[blend.bones[i]].rotation1106 }}}1107 {{{1108 pos += blend.weights[i] * animatedPoseMatrix * inverseRestMatrix * (position,1)1109 }}}1110 {{{1111 norm += blend.weights[i] * animatedPoseMatrix * inverseRestMatrix * (normal,0)1112 }}}1113 {{{1114 norm = normalise(norm)1115 }}}1116 {{{1117 1118 }}}1119 = [ Appendix B] =1120 = [ PSA File Format] =1121 PSA files store a skeletal animation, which consists of bone states at a number of keyframes (see Appendix A). Animations can only be applied to models with the same number of bones in the same order (no bone names are used, only indices). Although PSA contains a name field and a frame length field, these are no longer used in the game since animation variants and total animation lengths (so the same animation can be reused with different lengths) are given in the actor XML files.1122 1123 All types are stored in little-endian format. Text is always ASCII. The following is the version 1 PSA format:1124 1125 {{{1126 PSA {1127 }}}1128 {{{1129 char magic[4]; // == "PSSA"1130 }}}1131 {{{1132 u32 version; // == 11133 }}}1134 {{{1135 u32 data_size; // == filesize-121136 }}}1137 {{{1138 1139 }}}1140 {{{1141 u32 nameLength;1142 }}}1143 {{{1144 char name[nameLength]; // no longer used in the game1145 }}}1146 {{{1147 1148 }}}1149 {{{1150 float frameLength; // no longer used in the game, not valid for most of the animations1151 }}}1152 {{{1153 1154 }}}1155 {{{1156 u32 numBones;1157 }}}1158 {{{1159 u32 numFrames;1160 }}}1161 {{{1162 1163 }}}1164 {{{1165 BoneState boneStates[numBones * numFrames];1166 }}}1167 {{{1168 1169 }}}1170 {{{1171 // the state of bone b at frame f is stored in boneStates[f * numBones + b]1172 }}}1173 {{{1174 }1175 }}}1176 {{{1177 1178 }}}1179 {{{1180 BoneState {1181 }}}1182 {{{1183 Vector3D translation;1184 }}}1185 {{{1186 Quaternion rotation;1187 }}}1188 {{{1189 1190 }}}1191 {{{1192 // the bone's final transform matrix is translation * rotation, as in PMD1193 }}}1194 {{{1195 }1196 }}}1197 {{{1198 1199 }}}1200 {{{1201 Vector3D {1202 }}}1203 {{{1204 float x, y, z;1205 }}}1206 {{{1207 }1208 }}}1209 {{{1210 1211 }}}1212 {{{1213 Quaternion {1214 }}}1215 {{{1216 float x, y, z, w;1217 }}}1218 {{{1219 }1220 }}}1221 {{{1222 1223 }}}1224 {{{1225 1226 }}}1227 {{{1228 1229 }}}