A newbie here. I am trying to use the XNA infrastructure to render
some data, since all I need is points and colored triangles and a
movable camera.
Code snippet:
def SetupVerticies(self):
l = Array.CreateInstance(VertexPositionColor,6)
l[0] = VertexPositionColor(Vector3(0., 0., 0.), Color.White)
l[1] = VertexPositionColor(Vector3(5., 0., 0.), Color.White)
l[2] = VertexPositionColor(Vector3(10., 0., 0.), Color.White)
l[3] = VertexPositionColor(Vector3(5., 0., -5.), Color.White)
l[4] = VertexPositionColor(Vector3(0., 0., 0.), Color.White)
l[5] = VertexPositionColor(Vector3(10., 0., -5.), Color.White)
self.vertices = l
def CopyTerrainToGraphicsBuffers(self):
self.VertexBuffer = VertexBuffer(self.graphics.GraphicsDevice, \
len(self.vertices) * VertexPositionColor.SizeInBytes, \
BufferUsage.WriteOnly)
self.VertexBuffer.SetData(self.vertices)
This dies with:
TypeError: The type arguments for method 'SetData' cannot be inferred
from the usage. Try specifying the type arguments explicitly.
Any idea how to do this ?
_______________________________________________
Users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com