adding textures to 3D models

Nov 1, 2011 at 11:39 PM

Hi i am trying to add A 2D texture to a geometry node (the ground node)

 

           groundNode = new GeometryNode("Ground");
            groundNode.Model = new Box(50, 120, 0.1f);
            // Set this ground model to act as an occluder so that it appears transparent           

groundNode.IsOccluder = false;
            // Make the ground model to receive shadow casted by other objects with         

  // CastShadows set to true           

groundNode.Model.ReceiveShadows = true;            
            Material groundMaterial = new Material();           

groundMaterial.Diffuse = Color.White.ToVector4();           

groundMaterial.Specular = Color.Blue.ToVector4();           

groundMaterial.SpecularPower = 10;           

groundMaterial.Texture = Content.Load<Texture2D>("brick_wall_14");

            groundNode.Material = groundMaterial;
            groundMarkerNode.AddChild(groundNode);

 

brick_wall_14 is added to the content and set to always copy when doing this nothing seems to happen the ground does not change to the texture not sure what i am missing

Coordinator
Nov 2, 2011 at 1:44 AM

Geometries in Graphics.Geometry package does not include texture coordinates info. Reasons are mentioned in the User Manual. See how you need to do texture mapping in Tutorial 7.

Ohan