protected override void DrawPlayerModel(Player p)
        {
            Gfx.Texturing = true;
            Gfx.BindTexture(texId);

            for (int i = 0; i < RawParts.Count; i++)
            {
                RawPart raw = RawParts[i];
                Gfx.AlphaTest = raw.AlphaTest;

                if (raw.Wireframe)
                {
                    GL.PolygonMode(MaterialFace.FrontAndBack, PolygonMode.Line);
                }
                DrawRotate(p, raw, parts[i]);
                if (raw.Wireframe)
                {
                    GL.PolygonMode(MaterialFace.FrontAndBack, PolygonMode.Fill);
                }
            }

            /*
             * DrawRotate( 0, 24/16f, 0, -p.PitchRadians, 0, 0, model.Head );
             * DrawPart( model.Torso );
             * DrawRotate( 0, 12/16f, 0, p.leftLegXRot, 0, 0, model.LeftLeg );
             * DrawRotate( 0, 12/16f, 0, p.rightLegXRot, 0, 0, model.RightLeg );
             * DrawRotate( -6/16f, 22/16f, 0, p.leftArmXRot, 0, p.leftArmZRot, model.LeftArm );
             * DrawRotate( 6/16f, 22/16f, 0, p.rightArmXRot, 0, p.rightArmZRot, model.RightArm );
             *
             * Gfx.AlphaTest = true;
             * DrawRotate( 0, 24f/16f, 0, -p.PitchRadians, 0, 0, model.Hat );
             */
        }
Beispiel #2
0
        void BtnModelTexClick(object sender, EventArgs e)
        {
            string path = DoOpenFileDialog("Accepted File Types (*.png)|*.png|Images (*.png)|*.png");

            if (path == null)
            {
                return;
            }

            Gfx.DeleteTexture(ref texId);
            texId         = Gfx.CreateTexture(path, out IModel._64x64);
            p.Model.texId = texId;
        }
Beispiel #3
0
        void BtnGridTexClick(object sender, EventArgs e)
        {
            string path = DoOpenFileDialog("Accepted File Types (*.png)|*.png|Images (*.png)|*.png");

            if (path == null)
            {
                return;
            }

            Gfx.DeleteTexture(ref floorTexId);
            bool ignored;

            floorTexId = Gfx.CreateTexture(path, out ignored);
        }
Beispiel #4
0
        void PaintFloor()
        {
            Gfx.Texturing = true;
            Gfx.BindTexture(floorTexId);
            GL.Begin(BeginMode.Quads);
            GL.Color3(0.7f, 0.7f, 0.7f);

            GL.TexCoord2(0f, 0f); GL.Vertex3(-2f, -0.1f, -2f);
            GL.TexCoord2(2f, 0f); GL.Vertex3(2f, -0.1f, -2f);
            GL.TexCoord2(2f, 2f); GL.Vertex3(2f, -0.1f, 2f);
            GL.TexCoord2(0f, 2f); GL.Vertex3(-2f, -0.1f, 2f);

            GL.Color3(1f, 1f, 1f);
            GL.End();
            Gfx.Texturing = false;
        }