コード例 #1
0
 private void createSecondTypeDreidle()
 {
     for (int i = 0; i < k_NumOfDreidelsFromEachType; i++)
     {
         List <Model3D> modelList       = new List <Model3D>();
         List <Vector3> bodyCoordinates = Box3DSettings.CreateCoordsForBoxBodyTriangleStrip(-20, 20, -20, 20, -20, 20);
         List <Vector2> bodyTextureMap  = Box3DSettings.GetTextureMapTriangleStrip();
         modelList.Add(Creator3DModels.CreateModel(eModelType.TriangleStripAndTexture, Game, bodyCoordinates, bodyTextureMap, @"Textures\DreidelTexture"));
         List <Vector3> handleCoordinates = Box3DSettings.CreateCoordsForBoxBodyTriangleStrip(-3, 3, 20, 30, -3, 3);
         List <Color>   handleColors      = getColorList(Color.Blue, handleCoordinates.Count);
         modelList.Add(Creator3DModels.CreateModel(eModelType.TriangleStripAndColor, Game, handleCoordinates, handleColors));
         createPyramidAndAddToModelList(modelList, false);
         List <Vector3> bodyTopCoordinates = Box3DSettings.CreateCoordsForBoxTopTriangleStrip(-20, 20, 20, -20, 20);
         List <Color>   bodyTopColors      = getColorList(Color.LightGray, bodyTopCoordinates.Count);
         modelList.Add(Creator3DModels.CreateModel(eModelType.TriangleStripAndColor, Game, bodyTopCoordinates, bodyTopColors));
         List <Vector3> handleTopCoordinates = Box3DSettings.CreateCoordsForBoxTopTriangleStrip(-3, 3, 30, -3, 3);
         List <Color>   handleTopColors      = getColorList(Color.Blue, handleTopCoordinates.Count);
         modelList.Add(Creator3DModels.CreateModel(eModelType.TriangleStripAndColor, Game, handleTopCoordinates, handleTopColors));
         m_Dreidels.Add(new Dreidel(Game, modelList, this.m_MinDreidlePositionArray[m_PositionArrIndex], m_MaxDreidlePositionArray[m_PositionArrIndex]));
         m_PositionArrIndex++;
     }
 }
コード例 #2
0
 private void createThirdTypeDreidle()
 {
     for (int i = 0; i < k_NumOfDreidelsFromEachType; i++)
     {
         List <Model3D> modelList = new List <Model3D>();
         short[]        indexArray;
         List <Vector3> bodyCoordinates = Box3DSettings.CreateCoordsForBoxBodyTriangleListWithIndex(-20, 20, -20, 20, -20, 20, out indexArray);
         List <Vector2> bodyTextureMap  = Box3DSettings.GetTextureMapTriangleStrip();
         modelList.Add(Creator3DModels.CreateModel(eModelType.TriangleListAndTextureWithIndex, Game, bodyCoordinates, bodyTextureMap, @"Textures\DreidelTexture", indexArray));
         List <Vector3> handleCoordinates = Box3DSettings.CreateCoordsForBoxBodyTriangleListWithIndex(-3, 3, 20, 30, -3, 3, out indexArray);
         List <Color>   handleColors      = getColorList(Color.Red, handleCoordinates.Count);
         modelList.Add(Creator3DModels.CreateModel(eModelType.TriangleListAndColorWithIndex, Game, handleCoordinates, handleColors, indexArray));
         List <Vector3> bodyTopCoordinates = Box3DSettings.CreateCoordsForBoxTopTriangleListWithIndex(-20, 20, 20, -20, 20, out indexArray);
         List <Color>   bodyTopColors      = getColorList(Color.LightGray, bodyTopCoordinates.Count);
         modelList.Add(Creator3DModels.CreateModel(eModelType.TriangleListAndColorWithIndex, Game, bodyTopCoordinates, bodyTopColors, indexArray));
         List <Vector3> handleTopCoordinates = Box3DSettings.CreateCoordsForBoxTopTriangleListWithIndex(-3, 3, 30, -3, 3, out indexArray);
         List <Color>   handleTopColors      = getColorList(Color.Red, handleTopCoordinates.Count);
         modelList.Add(Creator3DModels.CreateModel(eModelType.TriangleListAndColorWithIndex, Game, handleTopCoordinates, handleTopColors, indexArray));
         createPyramidAndAddToModelList(modelList, true);
         m_Dreidels.Add(new Dreidel(Game, modelList, m_MinDreidlePositionArray[m_PositionArrIndex], m_MaxDreidlePositionArray[m_PositionArrIndex]));
         m_PositionArrIndex++;
     }
 }
コード例 #3
0
 private void createFirstTypeDreidle()
 {
     for (int i = 0; i < k_NumOfDreidelsFromEachType; i++)
     {
         List <Model3D> modelList       = new List <Model3D>();
         List <Vector3> bodyCoordinates = Box3DSettings.CreateCoordsForBoxBodyTriangleListWithoutIndex(-20, 20, -20, 20, -20, 20);
         List <Color>   bodyColors      = Box3DSettings.CreateColorForBoxBodyTriangleList(Color.Yellow, Color.LawnGreen, Color.Red, Color.Blue);
         modelList.Add(Creator3DModels.CreateModel(eModelType.TriangleListAndColor, Game, bodyCoordinates, bodyColors));
         List <Vector3> handleCoordinates = Box3DSettings.CreateCoordsForBoxBodyTriangleListWithoutIndex(-3, 3, 20, 30, -3, 3);
         List <Color>   handleColors      = getColorList(Color.Yellow, handleCoordinates.Count);
         modelList.Add(Creator3DModels.CreateModel(eModelType.TriangleListAndColor, Game, handleCoordinates, handleColors));
         List <Vector3> bodyTopCoordinates = Box3DSettings.CreateCoordsForBoxTopTriangleListWithoutIndex(-20, 20, 20, -20, 20);
         List <Color>   bodyTopColors      = getColorList(Color.LightGray, bodyTopCoordinates.Count);
         modelList.Add(Creator3DModels.CreateModel(eModelType.TriangleListAndColor, Game, bodyTopCoordinates, bodyTopColors));
         List <Vector3> handleTopCoordinates = Box3DSettings.CreateCoordsForBoxTopTriangleListWithoutIndex(-3, 3, 30, -3, 3);
         List <Color>   handleTopColors      = getColorList(Color.Yellow, handleTopCoordinates.Count);
         modelList.Add(Creator3DModels.CreateModel(eModelType.TriangleListAndColor, Game, handleTopCoordinates, handleTopColors));
         createLetters(modelList);
         createPyramidAndAddToModelList(modelList, false);
         m_Dreidels.Add(new Dreidel(Game, modelList, this.m_MinDreidlePositionArray[m_PositionArrIndex], m_MaxDreidlePositionArray[m_PositionArrIndex]));
         m_PositionArrIndex++;
     }
 }