Beispiel #1
0
        public Background(string tex)
        {
            Vbo  geom = Loader.GetGeom("background.obj");
            uint tex  = Loader.GetTex(tex);

            mesh = new Mesh(ref Vbo, tex);
        }
Beispiel #2
0
        static Mesh LoadMesh(string file)
        {
            XmlDocument config = Loader.GetConfig(file);
            XmlNode     geom   = config.SelectSingleNode("/mesh/geom");
            Vbo         g      = Loader.GetGeom(geom.InnerText);

            XmlNode tex  = config.SelectSingleNode("/mesh/texture");
            uint    t    = Loader.GetTex(tex.InnerText);
            XmlNode mat  = config.SelectSingleNode("/mesh/material");
            uint    m    = Loader.GetTex(mat.InnerText);
            XmlNode glow = config.SelectSingleNode("/mesh/glow");
            uint    gl   = Loader.GetTex(glow.InnerText);

            Material matl = new Material(t, m, gl);

            return(new Mesh(g, matl));
        }
Beispiel #3
0
        // This takes an XML file containing config info.
        static Mesh LoadBillboard(string file)
        {
            XmlDocument config = Loader.GetConfig(file);
            XmlNode     geom   = config.SelectSingleNode("/bb/geom");
            double      w      = Double.Parse(geom.Attributes["x"].Value);
            double      h      = Double.Parse(geom.Attributes["y"].Value);

            XmlNode tex    = config.SelectSingleNode("/bb/texture");
            Vbo     bgGeom = Loader.GetGeom("billboard.obj");
            uint    t      = Loader.GetTex(tex.InnerText);
            XmlNode mat    = config.SelectSingleNode("/bb/material");
            uint    m      = Loader.GetTex(mat.InnerText);
            XmlNode glow   = config.SelectSingleNode("/bb/glow");
            uint    g      = Loader.GetTex(glow.InnerText);

            Material matl = new Material(t, m, g);

            return(new Mesh(bgGeom, matl, new OpenTK.Vector2d(w, h)));
        }
Beispiel #4
0
 public Mesh(Vbo vbo, Material m, Vector2d s)
 {
     geometry = vbo;
     material = m;
     scale    = s;
 }
Beispiel #5
0
 public Mesh(Vbo vbo, Material m)
 {
     geometry = vbo;
     material = m;
     scale    = Vector2d.One;
 }