예제 #1
0
        public void PopulateFrom(LCC3Material anotherMaterial)
        {
            base.PopulateFrom(anotherMaterial);

            _ambientColor = anotherMaterial.AmbientColor;
            _diffuseColor = anotherMaterial.DiffuseColor;
            _specularColor = anotherMaterial.SpecularColor;
            _emissionColor = anotherMaterial.EmissionColor;
            _shininess = anotherMaterial.Shininess;
            _reflectivity = anotherMaterial.Reflectivity;
            _srcBlendType = anotherMaterial._srcBlendType;
            _dstBlendType = anotherMaterial._dstBlendType;
            _alphaTestFunc = anotherMaterial._alphaTestFunc;
            _shouldUseLighting = anotherMaterial._shouldUseLighting;

            _shaderContext = anotherMaterial.ShaderContext;
            _texture = anotherMaterial.Texture;

            _textureOverlays.Clear();

            _textureOverlays.AddRange(anotherMaterial.TextureOverlays);
        }
예제 #2
0
        private void InitializeParametricMeshMaterials()
        {
            _listOfMaterials = new List<LCC3Material>();

            LCC3GraphicsTexture2D crateTexData = new LCC3GraphicsTexture2D("Content/crate_map.jpg");
            LCC3GraphicsTexture2D beachBallTexData = new LCC3GraphicsTexture2D("Content/beachball.jpg");
            LCC3GraphicsTexture2D logoTexData = new LCC3GraphicsTexture2D("Content/logo.jpg");

            LCC3Texture crateTexture = new LCC3Texture(0, "crate");
            crateTexture.GraphicsTexture = crateTexData;
            crateTexture.TextureUnitMode = LCC3TextureUnitMode.Replace;

            LCC3Texture beachballTexture = new LCC3Texture(1, "beachball");
            beachballTexture.GraphicsTexture = beachBallTexData;
            beachballTexture.TextureUnitMode = LCC3TextureUnitMode.Replace;

            LCC3Texture logoTexture = new LCC3Texture(1, "logo");
            logoTexture.GraphicsTexture = logoTexData;
            logoTexture.TextureUnitMode = LCC3TextureUnitMode.Replace;

            LCC3Material multiTexMaterial = new LCC3Material(0, "sphereMaterial");
            multiTexMaterial.ShaderProgram = _materialShaderProgram;
            multiTexMaterial.AmbientColor = new CCColor4F(0.2f, 0.2f, 0.2f, 0.5f);
            multiTexMaterial.DiffuseColor = new CCColor4F(0.8f, 0.5f, 0.2f, 0.5f);
            multiTexMaterial.SpecularColor = new CCColor4F(1.0f, 0.6f, 0.0f, 1.0f);
            multiTexMaterial.EmissionColor = new CCColor4F(0.5f, 0.5f, 0.5f, 1.0f);
            multiTexMaterial.Shininess = 3.0f;
            multiTexMaterial.ShouldUseLighting = true;
            multiTexMaterial.AddTexture(beachballTexture);

            _listOfMaterials.Add(multiTexMaterial);

            multiTexMaterial = new LCC3Material(0, "coneMaterial");
            multiTexMaterial.ShaderProgram = _materialShaderProgram;
            multiTexMaterial.AmbientColor = new CCColor4F(0.1f, 0.1f, 0.1f, 0.3f);
            multiTexMaterial.DiffuseColor = new CCColor4F(0.8f, 0.5f, 0.2f, 0.8f);
            multiTexMaterial.SpecularColor = new CCColor4F(1.0f, 0.6f, 0.5f, 1.0f);
            multiTexMaterial.EmissionColor = new CCColor4F(0.9f, 0.5f, 0.5f, 1.0f);
            multiTexMaterial.Shininess = 3.0f;
            multiTexMaterial.ShouldUseLighting = true;
            multiTexMaterial.AddTexture(beachballTexture);

            _listOfMaterials.Add(multiTexMaterial);

            multiTexMaterial = new LCC3Material(0, "cubeMaterial");
            multiTexMaterial.ShaderProgram = _materialShaderProgram;
            multiTexMaterial.AmbientColor = new CCColor4F(0.5f, 0.5f, 0.5f, 1.0f);
            multiTexMaterial.DiffuseColor = new CCColor4F(1.0f, 0.58f, 0.8f, 1.0f);
            multiTexMaterial.SpecularColor = new CCColor4F(1.0f, 0.8f, 0.8f, 0.9f);
            multiTexMaterial.EmissionColor = new CCColor4F(0.3f, 0.4f, 0.2f, 1.0f);
            multiTexMaterial.Shininess = 1.0f;
            multiTexMaterial.ShouldUseLighting = true;
            multiTexMaterial.AddTexture(crateTexture);

            _listOfMaterials.Add(multiTexMaterial);

            multiTexMaterial = new LCC3Material(0, "planeMaterial");
            multiTexMaterial.ShaderProgram = _materialShaderProgram;
            multiTexMaterial.AmbientColor = new CCColor4F(1.0f, 1.0f, 1.0f, 1.0f);
            multiTexMaterial.DiffuseColor = new CCColor4F(0.5f, 0.5f, 1.2f, 0.5f);
            multiTexMaterial.SpecularColor = new CCColor4F(1.0f, 0.6f, 0.0f, 1.0f);
            multiTexMaterial.EmissionColor = new CCColor4F(0.8f, 0.8f, 0.8f, 1.0f);
            multiTexMaterial.Shininess = 1.0f;
            multiTexMaterial.ShouldUseLighting = true;
            multiTexMaterial.AddTexture(logoTexture);

            _listOfMaterials.Add(multiTexMaterial);
        }
예제 #3
0
        private void InitializeParametricMeshDrawingData()
        {
            _listOfShapeMeshes = new List<LCC3ParametricMeshes>();

            LCC3ParametricMeshes mesh = new LCC3ParametricMeshes(0, "sphere");
            mesh.PopulateAsSphere(3.0f, new LCC3Tessellation(50,50));

            _listOfShapeMeshes.Add(mesh);

            mesh = new LCC3ParametricMeshes(1, "cone");
            mesh.PopulateAsHollowCone(3.0f, 5.0f, new LCC3Tessellation(50, 50));

            _listOfShapeMeshes.Add(mesh);

            mesh = new LCC3ParametricMeshes(2, "box");
            mesh.PopulateAsSolidBox(new LCC3BoundingBox(0.0f, 0.0f, 0.0f, 5.0f, 5.0f, 5.0f), false);

            _listOfShapeMeshes.Add(mesh);

            mesh = new LCC3ParametricMeshes(3, "plane");
            mesh.PopulateAsRectangle(new CCSize(7.0f, 7.0f));

            _listOfShapeMeshes.Add(mesh);

            LCC3Scene scene = new LCC3Scene();
            scene.AmbientLight = new CCColor4F(1.0f, 1.0f, 1.0f, 1.0f);

            LCC3Material defaultMaterial = new LCC3Material(0, "Default");
            defaultMaterial.ShaderProgram = _materialShaderProgram;
            defaultMaterial.AmbientColor = new CCColor4F(0.2f, 1.0f, 0.0f, 1.0f);
            defaultMaterial.DiffuseColor = new CCColor4F(0.2f, 1.0f, 0.0f, 1.0f);
            defaultMaterial.SpecularColor = new CCColor4F(1.0f, 1.0f, 1.0f, 1.0f);
            defaultMaterial.EmissionColor = new CCColor4F(0.2f, 1.0f, 0.0f, 1.0f);
            defaultMaterial.Shininess = 0.0f;
            defaultMaterial.ShouldUseLighting = true;

            LCC3MeshNode meshNode = new LCC3MeshNode();
            meshNode.Material = defaultMaterial;
            meshNode.Mesh = mesh;
            meshNode.Parent = scene;

            LCC3Light[] lights = new LCC3Light[(int)LCC3Light.DefaultMaxNumOfLights];
            for (int i = 0; i < LCC3Light.DefaultMaxNumOfLights; i++)
            {
                lights[i] = new LCC3Light();
                lights[i].Visible = true;
                lights[i].Location = (new LCC3Vector(0.4f, -0.3f, -0.2f)).NormalizedVector();
                lights[i].AmbientColor = new CCColor4F(0.2f, 0.5f, 0.2f, 1.0f);
                lights[i].DiffuseColor = new CCColor4F(1.0f, 1.0f, 1.0f, 1.0f);
                lights[i].SpecularColor = new CCColor4F(0.9f, 0.9f, 0.9f, 1.0f);
            }

            scene.Lights = lights;

            _drawingVisitor = new LCC3NodeDrawingVisitor();
            _drawingVisitor.CurrentColor = new CCColor4F(1.0f, 0.0f, 0.0f, 1.0f);
            _drawingVisitor.CurrentNode = meshNode;
            _drawingVisitor.StartingNode = meshNode;

            _drawingVisitor.ModelMatrix = LCC3Matrix4x4.CC3MatrixIdentity;
            _drawingVisitor.ViewMatrix = new LCC3Matrix4x4(_graphicsContext.ViewMatrix.XnaMatrix);
            _drawingVisitor.ProjMatrix = new LCC3Matrix4x4(_graphicsContext.ProjectionMatrix.XnaMatrix);
            _drawingVisitor.ProgramPipeline = _progPipeline;

            //_progPipeline.BindProgramWithVisitor(_materialShaderProgram, _drawingVisitor);
        }
예제 #4
0
        private void InitializeMultiTextureMaterials()
        {
            _listOfMaterials = new List<LCC3Material>();

            LCC3GraphicsTexture2D crateTexData = new LCC3GraphicsTexture2D("Content/crate.jpg");
            LCC3GraphicsTexture2D logoTexData = new LCC3GraphicsTexture2D("Content/logo.gif");

            LCC3Texture crateTexture = new LCC3Texture(0, "crate");
            crateTexture.GraphicsTexture = crateTexData;
            crateTexture.TextureUnitMode = LCC3TextureUnitMode.Replace;

            LCC3Texture logoTexture = new LCC3Texture(1, "logo");
            logoTexture.GraphicsTexture = logoTexData;
            logoTexture.TextureUnitMode = LCC3TextureUnitMode.Blend;
            logoTexture.TextureUnitConstantColor = new CCColor4F(0.8f, 0.8f, 0.8f, 0.5f);

            LCC3Texture logoTextureDecal = new LCC3Texture(1, "logo");
            logoTextureDecal.GraphicsTexture = logoTexData;
            logoTextureDecal.TextureUnitMode = LCC3TextureUnitMode.Decal;
            logoTextureDecal.TextureUnitConstantColor = new CCColor4F(0.8f, 0.8f, 0.8f, 0.5f);

            LCC3Texture logoTextureReplace = new LCC3Texture(1, "logo");
            logoTextureReplace.GraphicsTexture = logoTexData;
            logoTextureReplace.TextureUnitMode = LCC3TextureUnitMode.Replace;
            logoTextureReplace.TextureUnitConstantColor = new CCColor4F(0.8f, 0.8f, 0.8f, 0.5f);

            LCC3Texture logoTextureBlendColor = new LCC3Texture(1, "logo");
            logoTextureBlendColor.GraphicsTexture = logoTexData;
            logoTextureBlendColor.TextureUnitMode = LCC3TextureUnitMode.Blend;
            logoTextureBlendColor.TextureUnitConstantColor = new CCColor4F(0.8f, 0.3f, 0.3f, 0.6f);

            LCC3Material multiTexMaterial = new LCC3Material(0, "Multitex");
            multiTexMaterial.ShaderProgram = _materialShaderProgram;
            multiTexMaterial.AmbientColor = new CCColor4F(0.5f, 0.1f, 0.1f, 1.0f);
            multiTexMaterial.DiffuseColor = new CCColor4F(0.8f, 0.5f, 0.2f, 0.5f);
            multiTexMaterial.SpecularColor = new CCColor4F(1.0f, 0.6f, 0.0f, 1.0f);
            multiTexMaterial.EmissionColor = new CCColor4F(0.5f, 0.5f, 0.5f, 1.0f);
            multiTexMaterial.Shininess = 1.0f;
            multiTexMaterial.ShouldUseLighting = true;
            multiTexMaterial.AddTexture(crateTexture);
            multiTexMaterial.AddTexture(logoTextureReplace);

            _listOfMaterials.Add(multiTexMaterial);

            multiTexMaterial = new LCC3Material(0, "Multitex");
            multiTexMaterial.ShaderProgram = _materialShaderProgram;
            multiTexMaterial.AmbientColor = new CCColor4F(0.5f, 0.1f, 0.1f, 1.0f);
            multiTexMaterial.DiffuseColor = new CCColor4F(0.8f, 0.5f, 0.2f, 0.5f);
            multiTexMaterial.SpecularColor = new CCColor4F(1.0f, 0.6f, 0.0f, 1.0f);
            multiTexMaterial.EmissionColor = new CCColor4F(0.5f, 0.5f, 0.5f, 1.0f);
            multiTexMaterial.Shininess = 1.0f;
            multiTexMaterial.ShouldUseLighting = true;
            multiTexMaterial.AddTexture(crateTexture);
            multiTexMaterial.AddTexture(logoTextureDecal);

            _listOfMaterials.Add(multiTexMaterial);

            multiTexMaterial = new LCC3Material(0, "Multitex");
            multiTexMaterial.ShaderProgram = _materialShaderProgram;
            multiTexMaterial.AmbientColor = new CCColor4F(0.5f, 0.1f, 0.1f, 1.0f);
            multiTexMaterial.DiffuseColor = new CCColor4F(0.8f, 0.5f, 0.2f, 0.5f);
            multiTexMaterial.SpecularColor = new CCColor4F(1.0f, 0.6f, 0.0f, 1.0f);
            multiTexMaterial.EmissionColor = new CCColor4F(0.5f, 0.5f, 0.5f, 1.0f);
            multiTexMaterial.Shininess = 1.0f;
            multiTexMaterial.ShouldUseLighting = true;
            multiTexMaterial.AddTexture(crateTexture);
            multiTexMaterial.AddTexture(logoTexture);

            _listOfMaterials.Add(multiTexMaterial);

            multiTexMaterial = new LCC3Material(0, "Multitex");
            multiTexMaterial.ShaderProgram = _materialShaderProgram;
            multiTexMaterial.AmbientColor = new CCColor4F(0.5f, 0.1f, 0.1f, 1.0f);
            multiTexMaterial.DiffuseColor = new CCColor4F(0.8f, 0.5f, 0.2f, 0.5f);
            multiTexMaterial.SpecularColor = new CCColor4F(1.0f, 0.6f, 0.0f, 1.0f);
            multiTexMaterial.EmissionColor = new CCColor4F(0.5f, 0.5f, 0.5f, 1.0f);
            multiTexMaterial.Shininess = 1.0f;
            multiTexMaterial.ShouldUseLighting = true;
            multiTexMaterial.AddTexture(crateTexture);
            multiTexMaterial.AddTexture(logoTextureBlendColor);

            _listOfMaterials.Add(multiTexMaterial);
        }
예제 #5
0
        private void InitializeMaterials()
        {
            _listOfMaterials = new List<LCC3Material>();

            LCC3GraphicsTexture2D tex2D = new LCC3GraphicsTexture2D("Content/crate.jpg");
            LCC3Texture tex = new LCC3Texture(0, "tex");
            tex.GraphicsTexture = tex2D;
            tex.TextureUnitMode = LCC3TextureUnitMode.Replace;

            LCC3GraphicsTexture2D anotherTex2D = new LCC3GraphicsTexture2D("Content/xamarin.jpeg");
            LCC3Texture tex2 = new LCC3Texture(1, "tex2");
            tex2.GraphicsTexture = anotherTex2D;
            tex2.TextureUnitMode = LCC3TextureUnitMode.Decal;

            LCC3Material material = new LCC3Material(0, "Glowy");
            material.ShaderProgram = _materialShaderProgram;
            material.AmbientColor = new CCColor4F(0.0f, 0.1f, 0.1f, 1.0f);
            material.DiffuseColor = new CCColor4F(0.5f, 0.5f, 1.0f, 0.5f);
            material.SpecularColor = new CCColor4F(1.0f, 1.0f, 0.0f, 1.0f);
            material.EmissionColor = new CCColor4F(0.5f, 0.5f, 0.0f, 1.0f);
            material.Shininess = 1.0f;
            material.ShouldUseLighting = true;
            material.AddTexture(tex);
            material.AddTexture(tex2);

            _listOfMaterials.Add(material);

            material = new LCC3Material(1, "Grass");
            material.ShaderProgram = _materialShaderProgram;
            material.AmbientColor = new CCColor4F(0.0f, 0.1f, 0.0f, 1.0f);
            material.DiffuseColor = new CCColor4F(0.0f, 0.2f, 0.0f, 0.2f);
            material.SpecularColor = new CCColor4F(0.0f, 1.0f, 0.0f, 1.0f);
            material.EmissionColor = new CCColor4F(0.0f, 0.1f, 0.0f, 1.0f);
            material.Shininess = 1.0f;
            material.ShouldUseLighting = true;
            material.AddTexture(tex);

            _listOfMaterials.Add(material);

            material = new LCC3Material(2, "Metal");
            material.ShaderProgram = _materialShaderProgram;
            material.AmbientColor = new CCColor4F(0.0f, 0.3f, 0.9f, 1.0f);
            material.DiffuseColor = new CCColor4F(0.0f, 0.0f, 1.0f, 1.0f);
            material.SpecularColor = new CCColor4F(0.1f, 0.8f, 0.5f, 1.0f);
            material.EmissionColor = new CCColor4F(0.0f, 0.2f, 1.0f, 1.0f);
            material.Shininess = 100.0f;
            material.ShouldUseLighting = true;
            material.AddTexture(tex);

            _listOfMaterials.Add(material);

            material = new LCC3Material(3, "Watery");
            material.ShaderProgram = _materialShaderProgram;
            material.AmbientColor = new CCColor4F(0.1f, 0.9f, 0.0f, 1.0f);
            material.DiffuseColor = new CCColor4F(0.9f, 0.5f, 0.9f, 0.5f);
            material.SpecularColor = new CCColor4F(0.0f, 0.0f, 0.9f, 1.0f);
            material.EmissionColor = new CCColor4F(0.1f, 0.15f, 0.15f, 1.0f);
            material.Shininess = 1.0f;
            material.ShouldUseLighting = true;
            material.AddTexture(tex);

            _listOfMaterials.Add(material);
        }
예제 #6
0
        private void InitializeMaterialDrawingData()
        {
            uint numOfVertices = 18;
            LCC3Mesh mesh = new LCC3Mesh(0, "mymesh");
            LCC3VertexLocations locations = new LCC3VertexLocations(1, "locations");
            locations.AllocateVertexCapacity(numOfVertices);
            // Top face
            locations.SetLocation(new LCC3Vector(0.0f, 0.0f, 0.0f), 0);
            locations.SetLocation(new LCC3Vector(0.0f, 0.0f, 5.0f), 1);
            locations.SetLocation(new LCC3Vector(5.0f, 0.0f, 0.0f), 2);

            locations.SetLocation(new LCC3Vector(5.0f, 0.0f, 0.0f), 3);
            locations.SetLocation(new LCC3Vector(5.0f, 0.0f, 5.0f), 4);
            locations.SetLocation(new LCC3Vector(0.0f, 0.0f, 5.0f), 5);

            // Side front face
            locations.SetLocation(new LCC3Vector(0.0f, 0.0f, 5.0f), 6);
            locations.SetLocation(new LCC3Vector(0.0f, -5.0f, 5.0f), 7);
            locations.SetLocation(new LCC3Vector(5.0f, 0.0f, 5.0f), 8);

            locations.SetLocation(new LCC3Vector(5.0f, 0.0f, 5.0f), 9);
            locations.SetLocation(new LCC3Vector(5.0f, -5.0f, 5.0f), 10);
            locations.SetLocation(new LCC3Vector(0.0f, -5.0f, 5.0f), 11);

            // Side left face
            locations.SetLocation(new LCC3Vector(0.0f, 0.0f, 0.0f), 12);
            locations.SetLocation(new LCC3Vector(0.0f, -5.0f, 0.0f), 13);
            locations.SetLocation(new LCC3Vector(0.0f, 0.0f, 5.0f), 14);

            locations.SetLocation(new LCC3Vector(0.0f, 0.0f, 5.0f), 15);
            locations.SetLocation(new LCC3Vector(0.0f, -5.0f, 5.0f), 16);
            locations.SetLocation(new LCC3Vector(0.0f, -5.0f, 0.0f), 17);

            LCC3VertexNormals normals = new LCC3VertexNormals(1, "normals");
            normals.AllocateVertexCapacity(numOfVertices);
            // Top face normals
            normals.SetNormalAtIndex(new LCC3Vector(-1.0f, 1.0f, -1.0f).NormalizedVector(), 0);
            normals.SetNormalAtIndex(new LCC3Vector(-1.0f, 1.0f, 1.0f).NormalizedVector(), 1);
            normals.SetNormalAtIndex(new LCC3Vector(1.0f, 1.0f, -1.0f).NormalizedVector(), 2);

            normals.SetNormalAtIndex(new LCC3Vector(1.0f, 1.0f, -1.0f).NormalizedVector(), 3);
            normals.SetNormalAtIndex(new LCC3Vector(1.0f, 1.0f, 1.0f).NormalizedVector(), 4);
            normals.SetNormalAtIndex(new LCC3Vector(-1.0f, 1.0f, 1.0f).NormalizedVector(), 5);

            // Side front face normals
            normals.SetNormalAtIndex(new LCC3Vector(-1.0f, 1.0f, 1.0f).NormalizedVector(), 6);
            normals.SetNormalAtIndex(new LCC3Vector(-1.0f, -1.0f, 1.0f).NormalizedVector(), 7);
            normals.SetNormalAtIndex(new LCC3Vector(1.0f, 1.0f, 1.0f).NormalizedVector(), 8);

            normals.SetNormalAtIndex(new LCC3Vector(1.0f, 1.0f, 1.0f).NormalizedVector(), 9);
            normals.SetNormalAtIndex(new LCC3Vector(1.0f, -1.0f, 1.0f).NormalizedVector(), 10);
            normals.SetNormalAtIndex(new LCC3Vector(-1.0f, -1.0f, 1.0f).NormalizedVector(), 11);

            // Side left face normals
            normals.SetNormalAtIndex(new LCC3Vector(-1.0f, 1.0f, -1.0f).NormalizedVector(), 12);
            normals.SetNormalAtIndex(new LCC3Vector(-1.0f, -1.0f, -1.0f).NormalizedVector(), 13);
            normals.SetNormalAtIndex(new LCC3Vector(-1.0f, 1.0f, 1.0f).NormalizedVector(), 14);

            normals.SetNormalAtIndex(new LCC3Vector(-1.0f, 1.0f, 1.0f).NormalizedVector(), 15);
            normals.SetNormalAtIndex(new LCC3Vector(-1.0f, -1.0f, 1.0f).NormalizedVector(), 16);
            normals.SetNormalAtIndex(new LCC3Vector(-1.0f, -1.0f, -1.0f).NormalizedVector(), 17);

            /*
            for (uint i=0; i < 6; i++)
            {
                normals.SetNormalAtIndex(new LCC3Vector(0.0f, 1.0f, 0.0f).NormalizedVector(), i);
                normals.SetNormalAtIndex(new LCC3Vector(0.0f, 0.0f, 1.0f).NormalizedVector(), i + 6);
                normals.SetNormalAtIndex(new LCC3Vector(-1.0f, 0.0f, 0.0f).NormalizedVector(), i + 12);
            }
            */

            LCC3VertexTextureCoordinates texCoords = new LCC3VertexTextureCoordinates(0, "texCoords");
            texCoords.AllocateVertexCapacity(numOfVertices);
            for (uint i=0; i < numOfVertices / 6; i++)
            {
                uint offset = i * 6;
                texCoords.SetTexCoord2FAtIndex(new CCTex2F(0.0f, 0.0f), 0 + offset);
                texCoords.SetTexCoord2FAtIndex(new CCTex2F(0.0f, 1.0f), 1 + offset);
                texCoords.SetTexCoord2FAtIndex(new CCTex2F(1.0f, 0.0f), 2 + offset);

                texCoords.SetTexCoord2FAtIndex(new CCTex2F(1.0f, 0.0f), 3 + offset);
                texCoords.SetTexCoord2FAtIndex(new CCTex2F(1.0f, 1.0f), 4 + offset);
                texCoords.SetTexCoord2FAtIndex(new CCTex2F(0.0f, 1.0f), 5 + offset);
            }

            LCC3VertexColors colors = new LCC3VertexColors(0, "colors");
            colors.AllocateVertexCapacity(numOfVertices);
            for (uint i=0; i < numOfVertices; i++)
            {
                colors.SetColor4FAtIndex(new CCColor4F(0.2f, 1.0f, 0.0f, 1.0f), i);
            }

            mesh.VertexLocations = locations;
            mesh.VertexNormals = normals;
            mesh.VertexTextureCoords = texCoords;
            //mesh.VertexColors = colors;

            LCC3Scene scene = new LCC3Scene();
            scene.AmbientLight = new CCColor4F(0.5f, 0.5f, 0.0f, 0.5f);

            LCC3Material defaultMaterial = new LCC3Material(0, "Default");
            defaultMaterial.ShaderProgram = _materialShaderProgram;
            defaultMaterial.AmbientColor = new CCColor4F(0.2f, 1.0f, 0.0f, 1.0f);
            defaultMaterial.DiffuseColor = new CCColor4F(0.2f, 1.0f, 0.0f, 0.0f);
            defaultMaterial.SpecularColor = new CCColor4F(1.0f, 1.0f, 1.0f, 1.0f);
            defaultMaterial.EmissionColor = new CCColor4F(0.2f, 1.0f, 0.0f, 1.0f);
            defaultMaterial.Shininess = 0.0f;
            defaultMaterial.ShouldUseLighting = true;

            LCC3MeshNode meshNode = new LCC3MeshNode();
            meshNode.Material = defaultMaterial;
            meshNode.Mesh = mesh;
            meshNode.Parent = scene;

            LCC3Light[] lights = new LCC3Light[(int)LCC3Light.DefaultMaxNumOfLights];
            for (int i = 0; i < LCC3Light.DefaultMaxNumOfLights; i++)
            {
                lights[i] = new LCC3Light();
                lights[i].Visible = true;
                lights[i].Location = (new LCC3Vector(0.0f, -1.0f, -0.2f)).NormalizedVector();
                lights[i].AmbientColor = new CCColor4F(0.0f, 0.5f, 0.0f, 1.0f);
                lights[i].DiffuseColor = new CCColor4F(1.0f, 1.0f, 1.0f, 1.0f);
                lights[i].SpecularColor = new CCColor4F(1.0f, 1.0f, 1.0f, 1.0f);
                }

            scene.Lights = lights;

            _drawingVisitor = new LCC3NodeDrawingVisitor();
            _drawingVisitor.CurrentColor = new CCColor4F(1.0f, 0.0f, 0.0f, 1.0f);
            _drawingVisitor.CurrentNode = meshNode;
            _drawingVisitor.StartingNode = meshNode;

            _drawingVisitor.ModelMatrix = LCC3Matrix4x4.CC3MatrixIdentity;
            _drawingVisitor.ViewMatrix = new LCC3Matrix4x4(_graphicsContext.ViewMatrix.XnaMatrix);
            _drawingVisitor.ProjMatrix = new LCC3Matrix4x4(_graphicsContext.ProjectionMatrix.XnaMatrix);

            _drawingVisitor.ProgramPipeline = _progPipeline;

            _progPipeline.BindProgramWithVisitor(_materialShaderProgram, _drawingVisitor);

            //_progPipeline.GenerateVertexBuffer();
        }