XNA 4.0 Drawing inside of Cylinder model
im making a simple XNA game and i have stuck trying to make the surrounding of my world. Atm i have a flat terrain on which im playing . I want to put around a big cylinder with a texture around it . SO from the terrain i will be able to see the texture on the inside of the cylinder.I have tried changing Culling settings but it eather didnt work or i did it wrong . Any suggestions on how my draw method should be ?开发者_开发知识库 Do i need a model specially made to be displayed from inside ? Any code or point to tutorial will help (i have tried a lot already). Thanks.
A sample of my last attempt.
private void DrawBackground(Model model)
{
RasterizerState stat = new RasterizerState();
stat.CullMode = CullMode.None;
foreach (ModelMesh mesh in model.Meshes)
{
foreach (BasicEffect effect in mesh.Effects)
{
effect.EnableDefaultLighting();
effect.PreferPerPixelLighting = true;
effect.World = Matrix.Identity;
// Use the matrices provided by the game camera
effect.View = gameCamera.ViewMatrix;
effect.Projection = gameCamera.ProjectionMatrix;
}
mesh.Draw();
}
I was trying to remember where I had seen a textured cylinder before, and then I stumbled across it on the MSDN site http://create.msdn.com.
Shader series - 2
精彩评论