basic questions
when moving objects within world, do i change my world position and then draw the object?
scenario
i created a shape class that has an array of CustomVertex.PositionColored
when the shape class is initialized i setup the vertexes.
do i upate the vertex position or do i move the world and then draw my object.. and then reposition my world and continue on with the next object?
also, for a rectangle made up of 8 triangles..
i draw a triangle strip of 9 vertexes.. is that the best way to go about it?
what is the difference or benefits of using one of the following 2 methods
this.vb.SetData(this.triangles, 0, LockFlags.None);
or
GraphicsStream gs = this.vb.Lock(0, 0, LockFlags.None);
gs.Write(this.triangles);
thank you
To move an object in the world, you want to move the world and draw your object. In general, you want to touch your vertex buffer data as little as possible.
Using a graphics stream allows a more general way of writing to the buffer by letting the vertex buffer work with things that take an abstract Stream object.
You probably want to use SetData, as it's pretty easy to use and is really just combining a lock, write, and unlock for you. How handy!
Using a graphics stream allows a more general way of writing to the buffer by letting the vertex buffer work with things that take an abstract Stream object.
You probably want to use SetData, as it's pretty easy to use and is really just combining a lock, write, and unlock for you. How handy!
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement