Zacinam s XNA a mam vytvorenu zakladnu aplikaciu a efekt. Nastavujem v nom maticu projekcie a potom vytvorim a vykreslim jeden trojiholnik. No niekde je chyba lebo ziadny trojuholnik nieje vidiet. mohol by sa mi niekto na to prosim pozriet.
metoda LoadContent :
efekt = new BasicEffect(GraphicsDevice);efekt.Projection = Matrix.CreatePerspectiveFieldOfView(MathHelper.Pi / 4 , GraphicsDevice.Viewport.Width / GraphicsDevice.Viewport.Height, 0.1f, 10f);
efekt.World = Matrix.Identity; efekt.VertexColorEnabled = true; trojuholnik[0] = new VertexPositionColor(new Vector3(80, 80, -1f), Color.Yellow); trojuholnik[1] = new VertexPositionColor(new Vector3(160, 260, -1f), Color.Yellow); trojuholnik[2] = new VertexPositionColor(new Vector3(80, 360, -1f), Color.Yellow);
metoda Draw :
GraphicsDevice.Clear(Color.Black);
efekt.CurrentTechnique.Passes[0].Apply();
GraphicsDevice.DrawUserPrimitives<VertexPositionColor>(PrimitiveType.TriangleList, body, 0, 1);
base.Draw(gameTime);