Ejemplo n.º 1
0
Archivo: Axis.cs Proyecto: konlil/pipe
        public override void Initialize()
        {
            base.Initialize();

            Mesh mesh = MeshBuilder.CreateAxis(Engine.GraphicsDevice);
            base.AddMesh(mesh);

            BasicMaterial material = new BasicMaterial(Engine);
            base.AddMaterial(material);

            RenderContext ctx = new RenderContext(Engine);
            ctx.Material = material;
            ctx.Mesh = mesh;
            base.AddRenderContext(ctx);

            BasicEffect eff = material.EffectInstance as BasicEffect;
            eff.VertexColorEnabled = true;
        }
Ejemplo n.º 2
0
Archivo: Quad.cs Proyecto: konlil/pipe
        public override void Initialize()
        {
            base.Initialize();

            Mesh mesh = MeshBuilder.CreateQuad(Engine.GraphicsDevice);
            base.AddMesh(mesh);

            BasicMaterial material = new BasicMaterial(Engine);
            base.AddMaterial(material);

            RenderContext ctx = new RenderContext(Engine);
            ctx.Mesh = mesh;
            ctx.Material = material;
            base.AddRenderContext(ctx);

            material.DiffuseTextureName = "Textures\\grid";
            material.DiffuseColor = new Vector3(0.0f, 1.0f, 0.0f);
            material.SpecularColor = new Vector3(1.0f, 1.0f, 1.0f);
            material.SpecularPower = 50;
        }