예제 #1
0
        private void createPyramidAndAddToModelList(List <Model3D> i_ModelList, bool i_IsWithIndex)
        {
            short[]        indexArray = null;
            List <Vector3> pyramidCoordinates;

            if (i_IsWithIndex)
            {
                pyramidCoordinates = Pyramid3DSettings.CreateCoordsForPyramidWithIndex(
                    -20,
                    20,
                    -35,
                    -20,
                    -20,
                    20,
                    out indexArray);
            }
            else
            {
                pyramidCoordinates = Pyramid3DSettings.CreateCoordsForPyramidWithoutIndex(-20, 20, -35, -20, -20, 20);
            }

            List <Color> pyramidColors = getColorList(Color.Gray, pyramidCoordinates.Count);

            i_ModelList.Add(
                Creator3DModels.CreateModel(
                    eModelType.TriangleListAndColor,
                    Game,
                    pyramidCoordinates,
                    pyramidColors,
                    indexArray));
        }
예제 #2
0
        private void createLetters(List <Model3D> i_ModelList)
        {
            List <Vector3> letterBCoordinates = LettersSetting.CreateLetterB();
            List <Color>   letterBColors      = getColorList(Color.Black, letterBCoordinates.Count);

            i_ModelList.Add(Creator3DModels.CreateModel(eModelType.TriangleListAndColor, Game, letterBCoordinates, letterBColors));
            List <Vector3> letterDCoordinates = LettersSetting.CreateLetterD();
            List <Color>   letterDColors      = getColorList(Color.Black, letterDCoordinates.Count);

            i_ModelList.Add(Creator3DModels.CreateModel(eModelType.TriangleListAndColor, Game, letterDCoordinates, letterDColors));
            List <Vector3> letterPCoordinates = LettersSetting.CreateLetterP();
            List <Color>   letterPColors      = getColorList(Color.Black, letterPCoordinates.Count);

            i_ModelList.Add(Creator3DModels.CreateModel(eModelType.TriangleListAndColor, Game, letterPCoordinates, letterPColors));
            List <Vector3> letterVCoordinates = LettersSetting.CreateLetterV();
            List <Color>   letterVColors      = getColorList(Color.Black, letterVCoordinates.Count);

            i_ModelList.Add(Creator3DModels.CreateModel(eModelType.TriangleListAndColor, Game, letterVCoordinates, letterVColors));
        }
예제 #3
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++;
     }
 }
예제 #4
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++;
     }
 }
예제 #5
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++;
     }
 }