public override void render(Graphics graphics, Camera camera) { calculateVertices(); if (isVisibleFromCamera(camera)) { _basicEffect.Projection = camera.getProjectionMatrix(); _basicEffect.View = camera.transformMatrix; _basicEffect.CurrentTechnique.Passes[0].Apply(); Core.graphicsDevice.DrawUserPrimitives(PrimitiveType.TriangleStrip, _vertices, 0, ribbonLength * 2 + 1); } }
public override void render(Graphics graphics, Camera camera) { if (isVisibleFromCamera(camera)) { _basicEffect.Projection = camera.getProjectionMatrix(); _basicEffect.View = camera.transformMatrix; _basicEffect.World = entity.transform.localToWorldTransform; _basicEffect.CurrentTechnique.Passes[0].Apply(); Core.graphicsDevice.SamplerStates[0] = Core.defaultSamplerState; Core.graphicsDevice.DrawUserPrimitives(primitiveType, verts, 0, _primitiveCount, VertexPositionColorTexture.VertexDeclaration); } }
public override void render(Graphics graphics, Camera camera) { if (isVisibleFromCamera(camera)) { _basicEffect.Projection = camera.getProjectionMatrix(); _basicEffect.View = camera.transformMatrix; _basicEffect.CurrentTechnique.Passes[0].Apply(); // TODO: set the _basicEffect.World = entity.transform.localToWorldTransform instead of manually mucking with verts and a local matrix Core.graphicsDevice.SamplerStates[0] = SamplerState.AnisotropicClamp; Core.graphicsDevice.DrawUserPrimitives(PrimitiveType.TriangleList, _verts, 0, _points.Length - 2, VertexPositionColor.VertexDeclaration); } }