I'm only starting with 3D so I have a question about drawing pretransformed stuff onto the screen.
I was able to figure out how to draw colored polygons in pretransformed form by using some tutorials, but I just can't understand how to texture them... Is that even possible? If so how?
What I have now:
private void TestVertices()
{
vertices = new VertexPositionColor[3];
vertices[0].Position = new Vector3(-0.5f, -0.5f, 0f);
vertices[0].Color = Color.Red;
vertices[1].Position = new Vector3(0, 0.5f, 0f);
vertices[1].Color = Color.Green;
vertices[2].Position = new Vector3(0.5f, -0.5f, 0f);
vertices[2].Color = Color.Blue;
}
and
protected override void Draw(GameTime gameTime)
{
device.Clear(Color.DarkSlateBlue);
effect.CurrentTechnique = effect.Techniques["Pretransformed"];
foreach (EffectPass pass in effect.CurrentTechnique.Passes)
{
pass.Apply();
device.DrawUserPrimitives(PrimitiveType.TriangleList, vertices, 0, 1, VertexPositionColor.VertexDeclaration);
}
base.Draw(gameTime);
}