sine wave works now
This commit is contained in:
@@ -9,12 +9,14 @@
|
||||
*/
|
||||
|
||||
#include "OpenGLUtils.h"
|
||||
#include <cstring>
|
||||
#include <vector>
|
||||
#include <math.h>
|
||||
|
||||
void svCol(Vertex &v, float newColour[4]){
|
||||
memcpy(&v.colour, &newColour, 4*sizeof(float));
|
||||
v.colour[0] = newColour[0];
|
||||
v.colour[1] = newColour[1];
|
||||
v.colour[2] = newColour[2];
|
||||
v.colour[3] = newColour[3];
|
||||
}
|
||||
|
||||
void setColour(std::vector<Vertex> &verticeList, float newColour[4]){
|
||||
@@ -23,10 +25,17 @@ void setColour(std::vector<Vertex> &verticeList, float newColour[4]){
|
||||
}
|
||||
}
|
||||
|
||||
void vTransform(std::vector<Vertex> &verticeList, int transform[2]){
|
||||
void vTransform(std::vector<Vertex> &verticeList, float x, float y){
|
||||
for(Vertex &v : verticeList){
|
||||
v.position[0] = transform[0];
|
||||
v.position[1] = transform[1];
|
||||
v.position[0] += x;
|
||||
v.position[1] += y;
|
||||
}
|
||||
}
|
||||
|
||||
void vScale(std::vector<Vertex> &verticeList, float x, float y){
|
||||
for(Vertex &v : verticeList){
|
||||
v.position[0] = v.position[0]*x;
|
||||
v.position[1] = v.position[1]*y;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user