public void AddPointsAtPosition(int count, float xPos, float yPos, float xVec, float yVec) { for (int i = 0; i < count; i++) { int index = RandomFuncts.GetRandomInt(0, this.pointSize); this.posX[index] = xPos + RandomFuncts.GetRandomFloat(1, 50); this.posY[index] = yPos + RandomFuncts.GetRandomFloat(1, 50); this.vecX[index] = xVec; this.vecY[index] = yVec; } }
public void InitPoints() { this.points = new VertexArray(PrimitiveType.Quads, (uint)this.pointSize * 4); this.posX = new float[this.pointSize]; this.posY = new float[this.pointSize]; this.vecX = new float[this.pointSize]; this.vecY = new float[this.pointSize]; for (uint i = 0; i < this.pointSize; i++) { this.posX[i] = RandomFuncts.GetRandomFloat(0, this.width); this.posY[i] = RandomFuncts.GetRandomFloat(0, this.height); this.vecX[i] = 0; this.vecY[i] = 0; Vertex vertex = new Vertex(); vertex.Position.X = this.posX[i]; vertex.Position.Y = this.posY[i]; vertex.Color = new Color((byte)RandomFuncts.GetRandomInt(0, 255), (byte)RandomFuncts.GetRandomInt(0, 255), (byte)RandomFuncts.GetRandomInt(0, 255)); this.points[i] = vertex; } }