예제 #1
0
        private void processLine(string line)
        {
            string[] parts = line.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);

            if (parts.Length > 0)
            {
                switch (parts[0])
                {
                case "nameobject":
                    NameEngine = parts[1];
                    break;

                case "params":
                    readparams(parts);
                    break;

                case "colors":
                    readcolors(parts);
                    break;

                case "v":
                    Vertex v = new Vertex();
                    v.LoadFromStringArray(parts);
                    VertexList.Add(v);
                    //  v.Index = VertexList.Count();
                    break;

                case "f":
                    Face f = new Face();
                    f.LoadFromStringArray(parts);
                    FaceList.Add(f);
                    break;
                }
            }
        }
예제 #2
0
        public void processLine(string line)
        {
            string[] parts = line.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);

            if (parts.Length > 0)
            {
                switch (parts[0])
                {
                case "namescene":
                    name = parts[1];
                    break;

                case "width":
                    width = Convert.ToInt32(parts[1]);
                    break;

                case "height":
                    height = Convert.ToInt32(parts[1]);
                    break;

                case "colorscene":
                    readColor(parts[1]);
                    break;

                case "coloringscene":
                    coloring = Convert.ToInt32(parts[1]);
                    break;

                case "forallobjs":
                    forallobjs = Convert.ToBoolean(parts[1]);
                    break;

                case "offcameras":
                    offcameras = Convert.ToBoolean(parts[1]);
                    break;

                case "panorama":
                    panorama = Convert.ToBoolean(parts[1]);
                    break;

                case "countobjects":
                    count_m = Convert.ToInt32(parts[1]);
                    break;

                case "countcameras":
                    count_c = Convert.ToInt32(parts[1]);
                    break;

                case "currentobject":
                    curr_m = Convert.ToInt32(parts[1]);
                    break;

                case "currentcamera":
                    curr_c = Convert.ToInt32(parts[1]);
                    break;

                case "projection":
                    projection = Convert.ToByte(parts[1]);
                    break;

                case "namecamera":
                    cameras.Add(new Camera());
                    cameras[cameras.Count - 1].Name = parts[1];
                    break;

                case "focus":
                    cameras[cameras.Count - 1].focus = Convert.ToDouble(parts[1]);
                    break;

                case "camparams":
                    readparamscamAng(parts);
                    break;

                case "scale":
                    cameras[cameras.Count - 1].scale = Convert.ToInt32(parts[1]);
                    break;

                case "center":
                    cameras[cameras.Count - 1].center = readparamscamCenter(parts);
                    break;

                case "eye":
                    cameras[cameras.Count - 1].eye = readparamscamEye(parts);
                    break;

                case "up":
                    cameras[cameras.Count - 1].up = readparamscamUp(parts);
                    break;

                case "nameobject":
                    Engines.Add(new Engine());
                    Engines[Engines.Count - 1].NameEngine = parts[1];
                    break;

                case "params":
                    readparams(parts);
                    break;

                case "colors":
                    readcolors(parts);
                    break;

                case "v":
                    Vertex v = new Vertex();
                    v.LoadFromStringArray(parts);
                    Engines[Engines.Count - 1].VertexList.Add(v);
                    break;

                case "f":
                    Face f = new Face();
                    f.LoadFromStringArray(parts);
                    Engines[Engines.Count - 1].FaceList.Add(f);
                    break;
                }
            }
        }