You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Something like that would probably work (but pass the Matrix by ref). I'd be interested to know how well this works.
you might also consider an overload of AddVertex that just takes a Vector3 instead, and then you can limit where you need to pass around Matrices, say to something like DrawPath.
The only potential snarl I see is that the batch is setup like a SpriteBatch, as an orthographic projection:
_standardEffect.Projection = Matrix.CreateOrthographicOffCenter(0, _device.Viewport.Width, _device.Viewport.Height, 0, -1, 1);
_standardEffect.World = _transform;
_standardEffect.CurrentTechnique.Passes[0].Apply();
So you may need to provide your own effect for any batch that's going to contain a perspective-aware transform.
Hello again mate, I know this is mostly for 2D, however I'm probably going to need some 3D transformations on this.
Should I do this in :
private void AddVertex (Vector2 position, Brush brush);
changing this method to and add a matrix to it, something like:
private void AddVertex (Vector2 position, Brush brush, Matrix m)
{
...
vertex.Position = Vector3.Transform(new Vector3(position, 0), m);
...
}
The text was updated successfully, but these errors were encountered: