示例#1
0
文件: Axis.cs 项目: 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;
        }
示例#2
0
文件: Quad.cs 项目: 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;
        }
示例#3
0
文件: Box.cs 项目: konlil/pipe
 public Box(PipeEngine engine)
     : base(engine)
 {
     m_ctx = new RenderContext(engine);
 }
示例#4
0
文件: Entity.cs 项目: konlil/pipe
 public virtual int AddRenderContext(RenderContext ctx)
 {
     render_contexts.Add(ctx);
     return render_contexts.Count - 1;
 }