我只是開始3D,所以我有一個關於繪畫pretransformed東西到屏幕上的問題。Pretransformed紋理多邊形
我能想出如何利用一些教程繪製在pretransformed形成有色的多邊形,但我只是不明白怎麼紋理他們...是,可能嗎?如果是這樣如何?
我現在擁有的一切:
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;
}
和
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);
}
[標題不需要標籤](http://meta.stackexchange.com/questions/19190/should-questions-include-tags-in-their-titles) – Default