
CREATING AN AVATAR
At previous lesson we talked about the "positional point" for the instalation of a "piece". But for some pieces we are introducing now a new concept to be used : the basecentral point.It will be used for pieces that can be in movement or have a cylindric form.
The avatar will be this kind of piece.
Another new thing: this piece has two AxisAngleRotation3D ! Normally we only will change the second for instalation. But we will use both to code the movements.
The definition of the piece is:
<MaterialGroup x:Key="charac1M">
<DiffuseMaterial>
<DiffuseMaterial.Brush>
<ImageBrush ImageSource="charac1.png" TileMode="None" ViewportUnits="Absolute" Viewport="0 0 1 1" AlignmentX="Left" AlignmentY="Top" Opacity="1.000000" />
</DiffuseMaterial.Brush>
</DiffuseMaterial>
<SpecularMaterial SpecularPower="29.8667">
<SpecularMaterial.Brush>
<SolidColorBrush Color="White" Opacity="1.000000"/>
</SpecularMaterial.Brush>
</SpecularMaterial>
</MaterialGroup>
<Transform3DGroup x:Key="charac1T">
<ScaleTransform3D ScaleX="0.1" ScaleY="0.1" ScaleZ="0.1" />
<RotateTransform3D>
<RotateTransform3D.Rotation>
<AxisAngleRotation3D Angle="90" Axis="1 0 0"/>
</RotateTransform3D.Rotation>
</RotateTransform3D>
<RotateTransform3D>
<RotateTransform3D.Rotation>
<AxisAngleRotation3D Angle="-90" Axis="0 1 0"/>
</RotateTransform3D.Rotation>
</RotateTransform3D>
<TranslateTransform3D OffsetX="0" OffsetY="1.5" OffsetZ="0" />
</Transform3DGroup>
<MeshGeometry3D x:Key="charac1G"
TriangleIndices="0,1,2 3,4,5 6,7,8 9,10,11 12,13,14 15,16,17 18,19,20 21,22,23 24,25,26 27,28,29 30,31,32 33,34,35 36,37,38 39,40,41 42,43,44 45,46,47 48,49,50 51,52,53 54,55,56 57,58,59 60,61,62 63,64,65 66,67,68 69,70,71 72,73,74 75,76,77 78,79,80 81,82,83 84,85,86 87,88,89 90,91,92 93,94,95 96,97,98 99,100,101 102,103,104 105,106,107 108,109,110 111,112,113 114,115,116 117,118,119 120,121,122 123,124,125 126,127,128 129,130,131 132,133,134 135,136,137 138,139,140 141,142,143 144,145,146 147,148,149 150,151,152 153,154,155 156,157,158 159,160,161 162,163,164 165,166,167 168,169,170 171,172,173 174,175,176 177,178,179 180,181,182 183,184,185 186,187,188 189,190,191 192,193,194 195,196,197 198,199,200 201,202,203 204,205,206 207,208,209 210,211,212 213,214,215 216,217,218 219,220,221 222,223,224 225,226,227 228,229,230 231,232,233 234,235,236 237,238,239 240,241,242 243,244,245 246,247,248 249,250,251 252,253,254 255,256,257 258,259,260 261,262,263 264,265,266 267,268,269 270,271,272 273,274,275 276,277,278 279,280,281 282,283,284 285,286,287 288,289,290 291,292,293 294,295,296 297,298,299 300,301,302 303,304,305 306,307,308 309,310,311 312,313,314 315,316,317 318,319,320 321,322,323 324,325,326 327,328,329 330,331,332 333,334,335 336,337,338 339,340,341 342,343,344 345,346,347 "
Normals="-0.292372,-0.411699,0.863147 -0.292372,-0.411699,0.863147 -0.292372,-0.411699,0.863147 -0.292372,-0.411699,0.863147 -0.292372,-0.411699,0.863147 -0.292372,-0.411699,0.863147 0.292372,0.4117,-0.863147 0.292372,0.4117,-0.863147 0.292375,0.411699,-0.863146 0.292377,0.411699,-0.863145 0.292372,0.4117,-0.863147 0.292375,0.411699,-0.863146 0.292381,0.411699,-0.863144 0.292377,0.411699,-0.863145 0.292375,0.411699,-0.863146 0.956305,-0.125869,0.263891 0.956305,-0.125869,0.263891 0.956305,-0.125869,0.263891 0.956305,-0.125869,0.263891 0.956305,-0.125869,0.263891 0.956305,-0.125869,0.263891 0.956305,-0.125869,0.263891 0.956305,-0.125869,0.263891 0.956305,-0.125869,0.263891 -3.41684e-008,-0.902585,-0.430511 -3.41684e-008,-0.902585,-0.430511 -3.41684e-008,-0.902585,-0.430511 4.05718e-009,-0.902585,-0.430511 4.05718e-009,-0.902585,-0.430511 4.05718e-009,-0.902585,-0.430511 -0.956305,0.125869,-0.263891 -0.956305,0.125869,-0.263891 -0.956305,0.125869,-0.263891 -0.956305,0.125869,-0.26389 -0.956305,0.125869,-0.26389 -0.956305,0.125869,-0.26389 -8.20296e-006,0.902586,0.430509 -8.20296e-006,0.902586,0.430509 -8.20296e-006,0.902586,0.430509 1.91002e-008,0.902585,0.430511 1.91002e-008,0.902585,0.430511 1.91002e-008,0.902585,0.430511 -1.52694e-007,0.902585,0.430511 -1.52694e-007,0.902585,0.430511 -1.52694e-007,0.902585,0.430511 0.243783,-0.242826,0.938939 0.243783,-0.242826,0.938939 0.243783,-0.242826,0.938939 0.243783,-0.242826,0.938939 0.243783,-0.242826,0.938939 0.243783,-0.242826,0.938939 -0.243783,0.242826,-0.938938 -0.243783,0.242826,-0.938938 -0.243783,0.242826,-0.938938 -0.243783,0.242826,-0.938938 -0.243782,0.242826,-0.938939 -0.243783,0.242826,-0.938938 0.96983,0.0610383,-0.236018 0.96983,0.0610385,-0.236018 0.96983,0.0610383,-0.236018 0.96983,0.0610383,-0.236018 0.96983,0.0610382,-0.236018 0.96983,0.0610383,-0.236018 -2.83088e-008,-0.968148,-0.250379 1.43843e-008,-0.968148,-0.250379 -2.83088e-008,-0.968148,-0.250379 -2.83088e-008,-0.968148,-0.250379 -7.10019e-008,-0.968148,-0.250379 -2.83088e-008,-0.968148,-0.250379 -0.96983,-0.0610383,0.236018 -0.96983,-0.0610384,0.236018 -0.96983,-0.0610383,0.236018 -0.96983,-0.0610383,0.236018 -0.96983,-0.0610382,0.236018 -0.96983,-0.0610383,0.236018 -5.40213e-008,0.968148,0.25038 -1.76545e-008,0.968148,0.25038 -5.40213e-008,0.968148,0.25038 -5.40213e-008,0.968148,0.25038 -9.03882e-008,0.968148,0.25038 -5.40213e-008,0.968148,0.25038 -7.24608e-008,4.59752e-007,1 -7.24608e-008,4.59752e-007,1 -7.24608e-008,4.59752e-007,1 -7.24608e-008,4.59752e-007,1 -7.24608e-008,4.59752e-007,1 -7.24608e-008,4.59752e-007,1 0.0158246,-0.00802877,-0.999843 0.0396265,-0.0424784,-0.998311 0.0158246,-0.00802877,-0.999843 0.0158246,-0.00802877,-0.999843 -0.00800516,0.0264349,-0.999618 0.0158246,-0.00802877,-0.999843 0.976304,-9.94913e-008,-0.216402 0.976304,-9.94913e-008,-0.216402 0.976304,-9.94913e-008,-0.216402 0.979274,-0.0255024,-0.200927 0.979274,-0.0255024,-0.200927 0.979274,-0.0255024,-0.200927 -2.41536e-008,-1,4.47409e-007 -2.41536e-008,-1,4.47409e-007 -2.41536e-008,-1,4.47409e-007 -1.10873e-007,-1,5.41643e-007 -1.10873e-007,-1,5.41643e-007 -1.10873e-007,-1,5.41643e-007 4.83073e-008,1,-4.82157e-007 4.83073e-008,1,-4.82157e-007 4.83073e-008,1,-4.82157e-007 3.14072e-008,1,-5.00718e-007 3.14072e-008,1,-5.00718e-007 3.14072e-008,1,-5.00718e-007 1.64888e-007,5.09002e-007,1 3.29776e-007,3.39335e-007,1 1.64888e-007,5.09002e-007,1 1.64888e-007,5.09002e-007,1 0,6.7867e-007,1 1.64888e-007,5.09002e-007,1 -2.79761e-014,-3.39335e-007,-1 -2.79761e-014,-3.39335e-007,-1 -2.79761e-014,-3.39335e-007,-1 -2.79761e-014,-3.39335e-007,-1 -2.79761e-014,-3.39335e-007,-1 -2.79761e-014,-3.39335e-007,-1 1,-8.48337e-008,9.44117e-008 1,-8.48337e-008,9.44117e-008 1,-8.48337e-008,9.44117e-008 1,-8.48337e-008,9.44118e-008 1,-8.48337e-008,9.44118e-008 1,-8.48337e-008,9.44118e-008 0,-1,5.19264e-007 0,-1,5.19264e-007 0,-1,5.19264e-007 -8.2444e-008,-1,6.13676e-007 -8.2444e-008,-1,6.13676e-007 -8.2444e-008,-1,6.13676e-007 -1,8.48337e-008,-4.72059e-008 -1,8.48337e-008,-4.72059e-008 -1,8.48337e-008,-4.72059e-008 -1,8.48337e-008,-4.72059e-008 -1,8.48337e-008,-4.72059e-008 -1,8.48337e-008,-4.72059e-008 -1.86808e-013,1,-5.6647e-007 -1.86808e-013,1,-5.6647e-007 -1.86808e-013,1,-5.6647e-007 8.2444e-008,1,-4.72058e-007 8.2444e-008,1,-4.72058e-007 8.2444e-008,1,-4.72058e-007 -4.83072e-008,5.10835e-007,1 -7.24608e-008,5.61919e-007,1 -4.83072e-008,5.10835e-007,1 -4.83072e-008,5.10835e-007,1 -2.41536e-008,4.59752e-007,1 -4.83072e-008,5.10835e-007,1 2.41536e-008,-5.61919e-007,-1 7.24608e-008,-6.64086e-007,-1 2.41536e-008,-5.61919e-007,-1 2.41536e-008,-5.61919e-007,-1 -2.41536e-008,-4.59752e-007,-1 2.41536e-008,-5.61919e-007,-1 1,-1.02167e-007,9.87615e-008 1,-1.02167e-007,9.87615e-008 1,-1.02167e-007,9.87615e-008 1,-1.02167e-007,9.87615e-008 1,-1.02167e-007,9.87615e-008 1,-1.02167e-007,9.87615e-008 -7.24609e-008,-1,5.43188e-007 -7.24609e-008,-1,5.43188e-007 -7.24609e-008,-1,5.43188e-007 -2.41536e-008,-1,4.44426e-007 -2.41536e-008,-1,4.44426e-007 -2.41536e-008,-1,4.44426e-007 -1,-1.02167e-007,-1.97523e-007 -1,-1.02167e-007,-1.97523e-007 -1,-1.02167e-007,-1.97523e-007 -1,-4.54057e-014,-9.87614e-008 -1,-4.54057e-014,-9.87614e-008 -1,-4.54057e-014,-9.87614e-008 2.41537e-008,1,-5.43188e-007 2.41537e-008,1,-5.43188e-007 2.41537e-008,1,-5.43188e-007 7.24608e-008,1,-4.44426e-007 7.24608e-008,1,-4.44426e-007 7.24608e-008,1,-4.44426e-007 -1.12906e-007,5.19369e-007,1 -1.12906e-007,5.19369e-007,1 -1.12906e-007,5.19369e-007,1 -1.12906e-007,5.19369e-007,1 -1.12906e-007,5.19369e-007,1 -1.12906e-007,5.19369e-007,1 1.12906e-007,-4.54448e-007,-1 1.12906e-007,-4.54448e-007,-1 1.12906e-007,-4.54448e-007,-1 1.12906e-007,-4.54448e-007,-1 1.12906e-007,-4.54448e-007,-1 1.12906e-007,-4.54448e-007,-1 1,-1.29842e-007,-1.4037e-007 1,-1.29842e-007,-1.4037e-007 1,-1.29842e-007,-1.4037e-007 1,-1.29842e-007,-1.4037e-007 1,-1.29842e-007,-1.4037e-007 1,-1.29842e-007,-1.4037e-007 -4.93965e-008,-1,4.64975e-007 -5.64532e-008,-1,4.73749e-007 -4.93965e-008,-1,4.64975e-007 -4.93965e-008,-1,4.64975e-007 -4.23399e-008,-1,4.56202e-007 -4.93965e-008,-1,4.64975e-007 -1,9.73817e-008,8.77312e-008 -1,1.62303e-007,1.57916e-007 -1,9.73817e-008,8.77312e-008 -1,9.73817e-008,8.77312e-008 -1,3.24606e-008,1.75462e-008 -1,9.73817e-008,8.77312e-008 5.50671e-014,1,-4.91295e-007 -5.64531e-008,1,-5.6148e-007 5.50671e-014,1,-4.91295e-007 5.50671e-014,1,-4.91295e-007 5.64532e-008,1,-4.2111e-007 5.50671e-014,1,-4.91295e-007 -1.69359e-007,4.54448e-007,1 -1.12906e-007,3.89527e-007,1 -1.69359e-007,4.54448e-007,1 -1.69359e-007,4.54448e-007,1 -2.25813e-007,5.19369e-007,1 -1.69359e-007,4.54448e-007,1 2.82265e-008,-4.86908e-007,-1 -5.64532e-008,-3.89527e-007,-1 2.82265e-008,-4.86908e-007,-1 2.82265e-008,-4.86908e-007,-1 1.12906e-007,-5.8429e-007,-1 2.82265e-008,-4.86908e-007,-1 1,-9.73815e-008,3.15832e-007 1,-3.24604e-008,2.45647e-007 1,-9.73815e-008,3.15832e-007 1,-9.73815e-008,3.15832e-007 1,-1.62303e-007,3.86017e-007 1,-9.73815e-008,3.15832e-007 -9.87931e-008,-1,5.26387e-007 -9.87931e-008,-1,5.26387e-007 -9.87931e-008,-1,5.26387e-007 -1.12906e-007,-1,5.43933e-007 -1.12906e-007,-1,5.43933e-007 -1.12906e-007,-1,5.43933e-007 -1,1.29842e-007,-5.46779e-014 -1,1.29842e-007,-5.46779e-014 -1,1.29842e-007,-5.46779e-014 -1,-1.29842e-007,-2.8074e-007 -1,-1.29842e-007,-2.8074e-007 -1,-1.29842e-007,-2.8074e-007 5.64532e-008,1,-4.2111e-007 5.64532e-008,1,-4.2111e-007 5.64532e-008,1,-4.2111e-007 5.64532e-008,1,-4.2111e-007 5.64532e-008,1,-4.2111e-007 5.64532e-008,1,-4.2111e-007 -5.64531e-008,5.38968e-007,1 0,4.89971e-007,1 -5.64531e-008,5.38968e-007,1 -5.64531e-008,5.38968e-007,1 -1.12906e-007,5.87965e-007,1 -5.64531e-008,5.38968e-007,1 -7.81597e-014,-4.89971e-007,-1 1.12906e-007,-5.87965e-007,-1 -7.81597e-014,-4.89971e-007,-1 -7.81597e-014,-4.89971e-007,-1 -1.12906e-007,-3.91977e-007,-1 -7.81597e-014,-4.89971e-007,-1 1,1.98952e-013,3.46246e-007 1,-9.79937e-008,6.92492e-007 1,1.98952e-013,3.46246e-007 1,1.98952e-013,3.46246e-007 1,9.79941e-008,-5.08951e-014 1,1.98952e-013,3.46246e-007 -1.12906e-007,-1,5.19369e-007 -5.64532e-008,-1,3.46246e-007 -1.12906e-007,-1,5.19369e-007 -1.12906e-007,-1,5.19369e-007 -1.69359e-007,-1,6.92492e-007 -1.12906e-007,-1,5.19369e-007 -1,1.65365e-007,-3.24606e-007 -1,2.57235e-007,-4.45332e-014 -1,1.65365e-007,-3.24606e-007 -1,1.65365e-007,-3.24606e-007 -1,7.34954e-008,-6.49211e-007 -1,1.65365e-007,-3.24606e-007 5.64531e-008,1,-3.46246e-007 0,1,-5.19369e-007 5.64531e-008,1,-3.46246e-007 5.64531e-008,1,-3.46246e-007 1.12906e-007,1,-1.73123e-007 5.64531e-008,1,-3.46246e-007 1.38302e-014,4.89971e-007,1 0,4.89971e-007,1 1.38302e-014,4.89971e-007,1 1.38302e-014,4.89971e-007,1 2.76604e-014,4.89971e-007,1 1.38302e-014,4.89971e-007,1 5.64531e-008,-4.40974e-007,-1 1.12906e-007,-4.89971e-007,-1 5.64531e-008,-4.40974e-007,-1 5.64531e-008,-4.40974e-007,-1 -2.21283e-014,-3.91977e-007,-1 5.64531e-008,-4.40974e-007,-1 1,-1.16368e-007,1.51483e-007 1,-7.34956e-008,2.54476e-014 1,-1.16368e-007,1.51483e-007 1,-1.16368e-007,1.51483e-007 1,-1.5924e-007,3.02965e-007 1,-1.16368e-007,1.51483e-007 -5.64531e-008,-1,3.46246e-007 -5.64531e-008,-1,3.46246e-007 -5.64531e-008,-1,3.46246e-007 -5.64532e-008,-1,3.46246e-007 -5.64532e-008,-1,3.46246e-007 -5.64532e-008,-1,3.46246e-007 -1,-9.79945e-008,-6.92492e-007 -1,-9.79945e-008,-6.92492e-007 -1,-9.79945e-008,-6.92492e-007 -1,-9.79944e-008,-6.92491e-007 -1,-9.79944e-008,-6.92491e-007 -1,-9.79944e-008,-6.92491e-007 2.82266e-008,1,-8.65614e-008 0,1,-1.73123e-007 2.82266e-008,1,-8.65614e-008 2.82266e-008,1,-8.65614e-008 5.64531e-008,1,3.90933e-014 2.82266e-008,1,-8.65614e-008 -0.978983,0.00563147,-0.203864 -0.979611,0.00648518,-0.200797 -0.979266,0.00324267,-0.202555 -0.978983,0.00563147,-0.203864 -0.979266,0.00324267,-0.202555 -0.978665,0.00520458,-0.205397 -0.978601,0.00703097,-0.205646 -0.978601,0.00703097,-0.205646 -0.978763,0.00148735,-0.204989 -0.978983,0.00563147,-0.203864 -0.978665,0.00520458,-0.205397 -0.978396,0.0104089,-0.206478 -0.978018,0.0069368,-0.208403 -0.978018,0.0069368,-0.208403 -0.978018,0.0069368,-0.208403 -0.978418,0.00941025,-0.206422 -0.978418,0.00941025,-0.206422 -0.978418,0.00941025,-0.206422 -0.978601,0.00703097,-0.205646 -0.978601,0.00703097,-0.205646 -0.978409,0.0125744,-0.206295 "
TextureCoordinates="0.947015,0.397453 0.959596,0.418184 0.920912,0.458646 0.920912,0.458646 0.899704,0.437915 0.947015,0.397453 -0.014577,0.727164 0.0403734,0.686702 0.0571706,0.666551 -0.0223539,0.706433 -0.014577,0.727164 0.0571706,0.666551 0.0373163,0.677507 -0.0223539,0.706433 0.0571706,0.666551 0.947015,0.397453 0.899704,0.437915 0.977646,0.706433 0.947015,0.397453 0.977646,0.706433 1.03732,0.677507 0.947015,0.397453 1.03732,0.677507 1.04841,0.648648 0.899704,0.437915 0.920912,0.458646 0.985423,0.727164 0.985423,0.727164 0.977646,0.706433 0.899704,0.437915 0.920912,0.458646 0.959596,0.418184 1.04037,0.686702 1.04037,0.686702 0.985423,0.727164 0.920912,0.458646 0.947015,0.397453 1.04841,0.648648 1.05717,0.666551 0.947015,0.397453 1.05717,0.666551 1.04037,0.686702 0.947015,0.397453 1.04037,0.686702 0.959596,0.418184 0.474684,0.40852 0.476514,0.389924 0.536233,0.413853 0.536233,0.413853 0.520306,0.432448 0.474684,0.40852 0.420828,0.70122 0.480165,0.725148 0.485704,0.706553 0.485704,0.706553 0.399477,0.682624 0.420828,0.70122 0.474684,0.40852 0.520306,0.432448 0.480165,0.725148 0.480165,0.725148 0.420828,0.70122 0.474684,0.40852 0.520306,0.432448 0.536233,0.413853 0.485704,0.706553 0.485704,0.706553 0.480165,0.725148 0.520306,0.432448 0.536233,0.413853 0.476514,0.389924 0.399477,0.682624 0.399477,0.682624 0.485704,0.706553 0.536233,0.413853 0.476514,0.389924 0.474684,0.40852 0.420828,0.70122 0.420828,0.70122 0.399477,0.682624 0.476514,0.389924 -0.599504,0.436295 0.0576868,0.436255 -0.0812058,0.438083 -0.0812058,0.438083 -0.458717,0.438124 -0.599504,0.436295 1.37059,0.742116 0.564549,0.736054 0.897771,0.746718 0.897771,0.746718 1.0875,0.739911 1.37059,0.742116 0.400496,0.436295 0.541283,0.438124 0.564549,0.736054 0.564549,0.736054 0.370592,0.742116 0.400496,0.436295 0.541283,0.438124 0.918794,0.438083 0.897771,0.746718 0.897771,0.746718 0.564549,0.736054 0.541283,0.438124 0.0576868,0.436255 0.400496,0.436295 0.370592,0.742116 0.370592,0.742116 0.0874983,0.739911 0.0576868,0.436255 -0.655694,0.774592 0.111474,0.774568 -0.12855,0.77677 -0.12855,0.77677 -0.408964,0.776794 -0.655694,0.774592 1.3431,0.978557 0.589431,0.980759 0.873071,0.980735 0.873071,0.980735 1.11265,0.978533 1.3431,0.978557 0.344306,0.774592 0.591036,0.776794 0.589431,0.980759 0.589431,0.980759 0.343104,0.978557 0.344306,0.774592 0.591036,0.776794 0.87145,0.77677 0.873071,0.980735 0.873071,0.980735 0.589431,0.980759 0.591036,0.776794 0.87145,0.77677 1.11147,0.774568 1.11265,0.978533 1.11265,0.978533 0.873071,0.980735 0.87145,0.77677 0.111474,0.774568 0.344306,0.774592 0.343104,0.978557 0.343104,0.978557 0.112652,0.978533 0.111474,0.774568 -0.598247,0.229479 0.0564555,0.229438 -0.0825728,0.231266 -0.0825728,0.231266 -0.457348,0.231307 -0.598247,0.229479 1.40057,0.424461 0.541362,0.426289 0.918716,0.426248 0.918716,0.426248 1.05762,0.42442 1.40057,0.424461 0.401753,0.229479 0.542652,0.231307 0.541362,0.426289 0.541362,0.426289 0.400568,0.424461 0.401753,0.229479 0.542652,0.231307 0.917427,0.231266 0.918716,0.426248 0.918716,0.426248 0.541362,0.426289 0.542652,0.231307 0.917427,0.231266 1.05646,0.229438 1.05762,0.42442 1.05762,0.42442 0.918716,0.426248 0.917427,0.231266 0.0564555,0.229438 0.401753,0.229479 0.400568,0.424461 0.400568,0.424461 0.0576167,0.42442 0.0564555,0.229438 0.403194,0.0895462 0.267777,0.0895288 0.650643,0.0909675 0.650643,0.0909675 0.5165,0.0909849 0.403194,0.0895462 0.402341,0.226732 0.515477,0.22817 0.648722,0.228153 0.648722,0.228153 0.267282,0.226714 0.402341,0.226732 0.403194,0.0895462 0.5165,0.0909849 0.515477,0.22817 0.515477,0.22817 0.402341,0.226732 0.403194,0.0895462 0.5165,0.0909849 0.650643,0.0909675 0.648722,0.228153 0.648722,0.228153 0.515477,0.22817 0.5165,0.0909849 0.650643,0.0909675 0.267777,0.0895288 0.267282,0.226714 0.267282,0.226714 0.648722,0.228153 0.650643,0.0909675 0.267777,0.0895288 0.403194,0.0895462 0.402341,0.226732 0.402341,0.226732 0.267282,0.226714 0.267777,0.0895288 0.184083,0.0895021 0.0555521,0.0894846 -0.0546408,0.0909233 -0.0546408,0.0909233 -0.173865,0.0909408 0.184083,0.0895021 0.184606,0.226687 -0.171532,0.228126 -0.0536341,0.228109 -0.0536341,0.228109 0.0563739,0.22667 0.184606,0.226687 0.184083,0.0895021 -0.173865,0.0909408 -0.171532,0.228126 -0.171532,0.228126 0.184606,0.226687 0.184083,0.0895021 0.826135,0.0909408 0.945359,0.0909233 0.946366,0.228109 0.946366,0.228109 0.828468,0.228126 0.826135,0.0909408 0.945359,0.0909233 1.05555,0.0894846 1.05637,0.22667 1.05637,0.22667 0.946366,0.228109 0.945359,0.0909233 0.0555521,0.0894846 0.184083,0.0895021 0.184606,0.226687 0.184606,0.226687 0.0563739,0.22667 0.0555521,0.0894846 0.403056,0.0301188 0.268649,0.0301014 0.686898,0.0320076 0.686898,0.0320076 0.550441,0.0320251 0.403056,0.0301188 0.402711,0.0857345 0.550087,0.0876408 0.686673,0.0876233 0.686673,0.0876233 0.268444,0.085717 0.402711,0.0857345 0.403056,0.0301188 0.550441,0.0320251 0.550087,0.0876408 0.550087,0.0876408 0.402711,0.0857345 0.403056,0.0301188 0.550441,0.0320251 0.686898,0.0320076 0.686673,0.0876233 0.686673,0.0876233 0.550087,0.0876408 0.550441,0.0320251 0.686898,0.0320076 0.268649,0.0301014 0.268444,0.085717 0.268444,0.085717 0.686673,0.0876233 0.686898,0.0320076 0.268649,0.0301014 0.403056,0.0301188 0.402711,0.0857345 0.402711,0.0857345 0.268444,0.085717 0.268649,0.0301014 0.184726,0.0300604 0.056785,0.0300429 -0.0873238,0.0319492 -0.0873238,0.0319492 -0.218202,0.0319667 0.184726,0.0300604 0.184933,0.0856761 -0.217901,0.0875824 -0.0869669,0.0875649 -0.0869669,0.0875649 0.0571158,0.0856586 0.184933,0.0856761 0.184726,0.0300604 -0.218202,0.0319667 -0.217901,0.0875824 -0.217901,0.0875824 0.184933,0.0856761 0.184726,0.0300604 0.781798,0.0319667 0.912676,0.0319492 0.913033,0.0875649 0.913033,0.0875649 0.782099,0.0875824 0.781798,0.0319667 0.912676,0.0319492 1.05678,0.0300429 1.05712,0.0856586 1.05712,0.0856586 0.913033,0.0875649 0.912676,0.0319492 0.056785,0.0300429 0.184726,0.0300604 0.184933,0.0856761 0.184933,0.0856761 0.0571158,0.0856586 0.056785,0.0300429 0.0373163,0.677507 -0.102229,0.746718 -0.0812058,0.438083 0.0373163,0.677507 -0.0812058,0.438083 0.0576868,0.436255 0.0576868,0.436255 0.0571706,0.666551 0.0484143,0.648648 0.0373163,0.677507 0.0576868,0.436255 0.0484143,0.648648 0.0373163,0.677507 0.0571706,0.666551 0.0874983,0.739911 0.0874983,0.739911 -0.102229,0.746718 0.0373163,0.677507 0.0571706,0.666551 0.0576868,0.436255 0.0874983,0.739911 "
Positions="-11.9828,-2.25216,-3.04853 -15.7221,-1.76,-4.08038 -15.7221,-5.87745,-6.0443 -15.7221,-5.87745,-6.0443 -11.9828,-6.36962,-5.01245 -11.9828,-2.25216,-3.04853 -11.1969,0.494705,-19.4038 -11.1969,4.61216,-17.4399 -7.56233,4.13378,-16.4369 -7.4576,0.00253671,-18.372 -11.1969,0.494705,-19.4038 -7.56233,4.13378,-16.4369 -7.4576,2.94608,-16.968 -7.4576,0.00253671,-18.372 -7.56233,4.13378,-16.4369 -11.9828,-2.25216,-3.04853 -11.9828,-6.36962,-5.01245 -7.4576,0.00253671,-18.372 -11.9828,-2.25216,-3.04853 -7.4576,0.00253671,-18.372 -7.4576,2.94608,-16.968 -11.9828,-2.25216,-3.04853 -7.4576,2.94608,-16.968 -7.74953,3.70891,-15.5462 -11.9828,-6.36962,-5.01245 -15.7221,-5.87745,-6.0443 -11.1969,0.494705,-19.4038 -11.1969,0.494705,-19.4038 -7.4576,0.00253671,-18.372 -11.9828,-6.36962,-5.01245 -15.7221,-5.87745,-6.0443 -15.7221,-1.76,-4.08038 -11.1969,4.61216,-17.4399 -11.1969,4.61216,-17.4399 -11.1969,0.494705,-19.4038 -15.7221,-5.87745,-6.0443 -11.9828,-2.25216,-3.04853 -7.74953,3.70891,-15.5462 -7.56233,4.13378,-16.4369 -11.9828,-2.25216,-3.04853 -7.56233,4.13378,-16.4369 -11.1969,4.61216,-17.4399 -11.9828,-2.25216,-3.04853 -11.1969,4.61216,-17.4399 -15.7221,-1.76,-4.08038 15.0286,0.706638,-3.62256 11.2364,0.467969,-2.6997 11.2364,-3.94857,-3.84189 11.2364,-3.94857,-3.84189 15.0286,-3.7099,-4.76475 15.0286,0.706638,-3.62256 11.2554,4.46501,-18.1552 11.2554,0.0484759,-19.2974 7.46319,-0.190193,-18.3745 7.46319,-0.190193,-18.3745 7.46319,4.22635,-17.2323 11.2554,4.46501,-18.1552 15.0286,0.706638,-3.62256 15.0286,-3.7099,-4.76475 11.2554,0.0484759,-19.2974 11.2554,0.0484759,-19.2974 11.2554,4.46501,-18.1552 15.0286,0.706638,-3.62256 15.0286,-3.7099,-4.76475 11.2364,-3.94857,-3.84189 7.46319,-0.190193,-18.3745 7.46319,-0.190193,-18.3745 11.2554,0.0484759,-19.2974 15.0286,-3.7099,-4.76475 11.2364,-3.94857,-3.84189 11.2364,0.467969,-2.6997 7.46319,4.22635,-17.2323 7.46319,4.22635,-17.2323 7.46319,-0.190193,-18.3745 11.2364,-3.94857,-3.84189 11.2364,0.467969,-2.6997 15.0286,0.706638,-3.62256 11.2554,4.46501,-18.1552 11.2554,4.46501,-18.1552 7.46319,4.22635,-17.2323 11.2364,0.467969,-2.6997 9.79592,5.55171,-5.04566 -9.94593,5.55172,-5.04566 -9.94594,-3.78275,-5.04566 -9.94594,-3.78275,-5.04566 9.79592,-3.78275,-5.04566 9.79592,5.55171,-5.04566 6.6883,5.55171,-20.1915 6.52538,-3.78275,-19.8008 -6.81296,-3.78275,-20.3302 -6.81296,-3.78275,-20.3302 -6.7752,5.55171,-20.0837 6.6883,5.55171,-20.1915 9.79592,5.55171,-5.04566 9.79592,-3.78275,-5.04566 6.52538,-3.78275,-19.8008 6.52538,-3.78275,-19.8008 6.6883,5.55171,-20.1915 9.79592,5.55171,-5.04566 9.79592,-3.78275,-5.04566 -9.94594,-3.78275,-5.04566 -6.81296,-3.78275,-20.3302 -6.81296,-3.78275,-20.3302 6.52538,-3.78275,-19.8008 9.79592,-3.78275,-5.04566 -9.94593,5.55172,-5.04566 9.79592,5.55171,-5.04566 6.6883,5.55171,-20.1915 6.6883,5.55171,-20.1915 -6.7752,5.55171,-20.0837 -9.94593,5.55172,-5.04566 5.66379,6.52101,-21.8094 -5.90374,6.52101,-21.8094 -5.90374,-4.72067,-21.8094 -5.90374,-4.72067,-21.8094 5.66379,-4.72067,-21.8094 5.66379,6.52101,-21.8094 5.66379,6.52101,-31.9106 5.66379,-4.72068,-31.9106 -5.90374,-4.72068,-31.9106 -5.90374,-4.72068,-31.9106 -5.90374,6.52101,-31.9106 5.66379,6.52101,-31.9106 5.66379,6.52101,-21.8094 5.66379,-4.72067,-21.8094 5.66379,-4.72068,-31.9106 5.66379,-4.72068,-31.9106 5.66379,6.52101,-31.9106 5.66379,6.52101,-21.8094 5.66379,-4.72067,-21.8094 -5.90374,-4.72067,-21.8094 -5.90374,-4.72068,-31.9106 -5.90374,-4.72068,-31.9106 5.66379,-4.72068,-31.9106 5.66379,-4.72067,-21.8094 -5.90374,-4.72067,-21.8094 -5.90374,6.52101,-21.8094 -5.90374,6.52101,-31.9106 -5.90374,6.52101,-31.9106 -5.90374,-4.72068,-31.9106 -5.90374,-4.72067,-21.8094 -5.90374,6.52101,-21.8094 5.66379,6.52101,-21.8094 5.66379,6.52101,-31.9106 5.66379,6.52101,-31.9106 -5.90374,6.52101,-31.9106 -5.90374,6.52101,-21.8094 9.79592,5.55172,5.19678 -9.94594,5.55172,5.19678 -9.94593,-3.78274,5.19679 -9.94593,-3.78274,5.19679 9.79592,-3.78274,5.19679 9.79592,5.55172,5.19678 9.79592,5.55171,-4.45956 9.79592,-3.78275,-4.45956 -9.94593,-3.78275,-4.45956 -9.94593,-3.78275,-4.45956 -9.94593,5.55172,-4.45956 9.79592,5.55171,-4.45956 9.79592,5.55172,5.19678 9.79592,-3.78274,5.19679 9.79592,-3.78275,-4.45956 9.79592,-3.78275,-4.45956 9.79592,5.55171,-4.45956 9.79592,5.55172,5.19678 9.79592,-3.78274,5.19679 -9.94593,-3.78274,5.19679 -9.94593,-3.78275,-4.45956 -9.94593,-3.78275,-4.45956 9.79592,-3.78275,-4.45956 9.79592,-3.78274,5.19679 -9.94593,-3.78274,5.19679 -9.94594,5.55172,5.19678 -9.94593,5.55172,-4.45956 -9.94593,5.55172,-4.45956 -9.94593,-3.78275,-4.45956 -9.94593,-3.78274,5.19679 -9.94594,5.55172,5.19678 9.79592,5.55172,5.19678 9.79592,5.55171,-4.45956 9.79592,5.55171,-4.45956 -9.94593,5.55172,-4.45956 -9.94594,5.55172,5.19678 9.68143,5.44604,12.1279 1.23483,5.44604,12.1279 1.23483,-1.89882,12.1279 1.23483,-1.89882,12.1279 9.68143,-1.89882,12.1279 9.68143,5.44604,12.1279 9.68143,5.44604,5.33385 9.68143,-1.89883,5.33385 1.23483,-1.89883,5.33385 1.23483,-1.89883,5.33385 1.23483,5.44604,5.33385 9.68143,5.44604,5.33385 9.68143,5.44604,12.1279 9.68143,-1.89882,12.1279 9.68143,-1.89883,5.33385 9.68143,-1.89883,5.33385 9.68143,5.44604,5.33385 9.68143,5.44604,12.1279 9.68143,-1.89882,12.1279 1.23483,-1.89882,12.1279 1.23483,-1.89883,5.33385 1.23483,-1.89883,5.33385 9.68143,-1.89883,5.33385 9.68143,-1.89882,12.1279 1.23483,-1.89882,12.1279 1.23483,5.44604,12.1279 1.23483,5.44604,5.33385 1.23483,5.44604,5.33385 1.23483,-1.89883,5.33385 1.23483,-1.89882,12.1279 1.23483,5.44604,12.1279 9.68143,5.44604,12.1279 9.68143,5.44604,5.33385 9.68143,5.44604,5.33385 1.23483,5.44604,5.33385 1.23483,5.44604,12.1279 -1.51232,5.55334,12.1279 -9.95892,5.55334,12.1279 -9.95892,-1.79153,12.1279 -9.95892,-1.79153,12.1279 -1.51232,-1.79153,12.1279 -1.51232,5.55334,12.1279 -1.51232,5.55333,5.33385 -1.51232,-1.79154,5.33385 -9.95892,-1.79153,5.33385 -9.95892,-1.79153,5.33385 -9.95892,5.55333,5.33385 -1.51232,5.55333,5.33385 -1.51232,5.55334,12.1279 -1.51232,-1.79153,12.1279 -1.51232,-1.79154,5.33385 -1.51232,-1.79154,5.33385 -1.51232,5.55333,5.33385 -1.51232,5.55334,12.1279 -1.51232,-1.79153,12.1279 -9.95892,-1.79153,12.1279 -9.95892,-1.79153,5.33385 -9.95892,-1.79153,5.33385 -1.51232,-1.79154,5.33385 -1.51232,-1.79153,12.1279 -9.95892,-1.79153,12.1279 -9.95892,5.55334,12.1279 -9.95892,5.55333,5.33385 -9.95892,5.55333,5.33385 -9.95892,-1.79153,5.33385 -9.95892,-1.79153,12.1279 -9.95892,5.55334,12.1279 -1.51232,5.55334,12.1279 -1.51232,5.55333,5.33385 -1.51232,5.55333,5.33385 -9.95892,5.55333,5.33385 -9.95892,5.55334,12.1279 9.71793,5.50456,15.0704 1.27133,5.50456,15.0704 1.27133,-4.2274,15.0704 1.27133,-4.2274,15.0704 9.71793,-4.2274,15.0704 9.71793,5.50456,15.0704 9.71793,5.50455,12.3161 9.71794,-4.2274,12.3161 1.27133,-4.2274,12.3161 1.27133,-4.2274,12.3161 1.27133,5.50456,12.3161 9.71793,5.50455,12.3161 9.71793,5.50456,15.0704 9.71793,-4.2274,15.0704 9.71794,-4.2274,12.3161 9.71794,-4.2274,12.3161 9.71793,5.50455,12.3161 9.71793,5.50456,15.0704 9.71793,-4.2274,15.0704 1.27133,-4.2274,15.0704 1.27133,-4.2274,12.3161 1.27133,-4.2274,12.3161 9.71794,-4.2274,12.3161 9.71793,-4.2274,15.0704 1.27133,-4.2274,15.0704 1.27133,5.50456,15.0704 1.27133,5.50456,12.3161 1.27133,5.50456,12.3161 1.27133,-4.2274,12.3161 1.27133,-4.2274,15.0704 1.27133,5.50456,15.0704 9.71793,5.50456,15.0704 9.71793,5.50455,12.3161 9.71793,5.50455,12.3161 1.27133,5.50456,12.3161 1.27133,5.50456,15.0704 -1.5195,5.68399,15.0704 -9.96611,5.68399,15.0704 -9.9661,-4.04796,15.0704 -9.9661,-4.04796,15.0704 -1.5195,-4.04796,15.0704 -1.5195,5.68399,15.0704 -1.5195,5.68399,12.3161 -1.5195,-4.04797,12.3161 -9.9661,-4.04797,12.3161 -9.9661,-4.04797,12.3161 -9.9661,5.68399,12.3161 -1.5195,5.68399,12.3161 -1.5195,5.68399,15.0704 -1.5195,-4.04796,15.0704 -1.5195,-4.04797,12.3161 -1.5195,-4.04797,12.3161 -1.5195,5.68399,12.3161 -1.5195,5.68399,15.0704 -1.5195,-4.04796,15.0704 -9.9661,-4.04796,15.0704 -9.9661,-4.04797,12.3161 -9.9661,-4.04797,12.3161 -1.5195,-4.04797,12.3161 -1.5195,-4.04796,15.0704 -9.9661,-4.04796,15.0704 -9.96611,5.68399,15.0704 -9.9661,5.68399,12.3161 -9.9661,5.68399,12.3161 -9.9661,-4.04797,12.3161 -9.9661,-4.04796,15.0704 -9.96611,5.68399,15.0704 -1.5195,5.68399,15.0704 -1.5195,5.68399,12.3161 -1.5195,5.68399,12.3161 -9.9661,5.68399,12.3161 -9.96611,5.68399,15.0704 -7.4576,2.94608,-16.968 -6.81296,-3.78275,-20.3302 -9.94594,-3.78275,-5.04566 -7.4576,2.94608,-16.968 -9.94594,-3.78275,-5.04566 -9.94593,5.55172,-5.04566 -9.94593,5.55172,-5.04566 -7.56233,4.13378,-16.4369 -7.74953,3.70891,-15.5462 -7.4576,2.94608,-16.968 -9.94593,5.55172,-5.04566 -7.74953,3.70891,-15.5462 -7.4576,2.94608,-16.968 -7.56233,4.13378,-16.4369 -6.7752,5.55171,-20.0837 -6.7752,5.55171,-20.0837 -6.81296,-3.78275,-20.3302 -7.4576,2.94608,-16.968 -7.56233,4.13378,-16.4369 -9.94593,5.55172,-5.04566 -6.7752,5.55171,-20.0837 "
/>
The texture of the piece, that can be changed, like we did for the demo, (remember to recompile), is included in the download. Important to note that it is inverted and deformed:
An avatar is an object, a piece some like others that has "cardinality". The main difference is that the avatar will change his "cardinality" dinamicaly.
An avatar will turn to and move ahead in the South direction when "k" is pressed. North for "i". West for "j". East for "l".
The Transform (position + orientation) of a 3D piece is defined by a matrix having 16 elements. The elements 13, 14 and 15 are the X, Y and Z positions of the piece. To move a piece we will use these points like you can analise in the downloadable code.
A Quaternion represents a rotation in the space of 3 dimensions. It's defined by an axis of rotation and an angle. To aply the rotation we need to define a "point of rotation".
For the movement to South, we define for the "k" key pressed:
...
if (e.Key == Key.K ){
TheZ=TheZ+1;
trans = new Matrix3D(0.1,0,0,0,0,0.1,0,0,0,0,0.1,0,TheX ,TheY,TheZ,1);
Quaternion qt = new Quaternion(new Vector3D(1, 0, 0),90);
Point3D pt = new Point3D(TheX , TheY,TheZ);
trans.RotateAt(qt,pt);
qt = new Quaternion(new Vector3D(0, 1, 0),180);
trans.RotateAt(qt,pt);
mtrans= new MatrixTransform3D(trans);
ModelVisual3D mv3D = VP.Children[0] as ModelVisual3D;
Model3DGroup m3Dg = mv3D.Content as Model3DGroup;
m3Dg.Children[4].Transform= mtrans ;
}
...
Important to note that we have defined some variables:
... Double TheZ = 0; Double TheX = 0; Double TheY=1.5; Matrix3D trans; MatrixTransform3D mtrans; ...
You can see in the demo that the avatar moves OK (remember: the keys are "i", "k", "j", "l") but it's crossing the wall like a ghost! We will talk about collision detection in the next lesson.
To look the source codes and/or run the exercice, create a folder having the name of the .ZIP file and download it - right-clicking the link - and unzip inside the folder :
Try to recreate the exercice changing the code or some texture (try the "medieval man" you see at this page, by example).
Liberate the firewall and play this web3d application:
![]() |
We are doing our tests at a: Notebook DELL Latitude D600 - Intel Pentium M755 2.0 GHZ - Memory: 512 MB - VideoCard ATI Radeon 9000 32MB DDR 4xAGP - Resolution 1400x1050 - Communication: ADSL 256 kbps (Download: 45 kBps, Upload: 14 kBps)
PREVIOUS LESSON NEXT LESSON T.CONTENTS HOMEPAGE
