Exemplo n.º 1
0
        // -------------------------------------

        private GameObject CreateTriangle(float x, float z)
        {
            GameObject obj = CreateChild(x, z);

            MeshBuilder builder = new MeshBuilder();

            builder.Cap(PrimitiveBuilder.CreateUnitPolygon(3));
            Mesh mesh = builder.Build();

            NodeBuilder.SetMesh(obj, mesh);
            return(obj);
        }
Exemplo n.º 2
0
        private GameObject CreatePentagonUp(float x, float z)
        {
            GameObject obj = CreateChild(x, z);

            MeshBuilder builder = new MeshBuilder();
            PointList   pointsA = PrimitiveBuilder.CreateUnitPolygon(5);
            PointList   pointsB = pointsA.Translate(new Vector3(0f, 1f, 0f));

            builder.Cap(pointsA.Bridge(pointsB, PointList.BridgeMode.CloseReuse));
            builder.Cap(pointsB);
            builder.Cap(pointsA.Reverse());
            Mesh mesh = builder.Build();

            NodeBuilder.SetMesh(obj, mesh);
            return(obj);
        }
Exemplo n.º 3
0
        private GameObject CreatePentagonHop(float x, float z)
        {
            GameObject obj = CreateChild(x, z);

            MeshBuilder      builder = new MeshBuilder();
            PointList        pointsA = PrimitiveBuilder.CreateUnitPolygon(5);
            PointList        pointsB = pointsA.Translate(new Vector3(0f, 1f, 0f));
            List <PointList> list    = pointsA.Bridge(pointsB, PointList.BridgeMode.CloseReuse);

            list.Add(pointsB);
            list.Add(pointsA.Reverse());
            foreach (PointList points in list)
            {
                Extend(points, builder);
            }
            Mesh mesh = builder.Build();

            NodeBuilder.SetMesh(obj, mesh);
            return(obj);
        }