Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Diff: Rasturizer/Rasturizer.cpp
- Revision:
- 22:236319885874
- Parent:
- 21:6b5d2d75e083
- Child:
- 25:3995271e411c
--- a/Rasturizer/Rasturizer.cpp Tue Apr 02 17:40:59 2019 +0000
+++ b/Rasturizer/Rasturizer.cpp Wed Apr 03 15:11:12 2019 +0000
@@ -10,7 +10,6 @@
}
}
-
void Rasturizer::init(){
lcd.init();
fov = 50;
@@ -34,17 +33,10 @@
void Rasturizer::drawFace(Face *face, float angle){
float points[4][3];
- float y;
- float x;
+ float y, x;
+ int diffX1, diffY1, diffX2, diffY2;
+ float step, stepSmall1, stepSmall2;
- int diffX1;
- int diffY1;
- int diffX2;
- int diffY2;
-
- float step;
- float stepSmall1;
- float stepSmall2;
for(int vertex = 0; vertex < 4; vertex++){
for(int axis = 0; axis < 3; axis++){
points[vertex][axis] = face->getVertexValue(vertex, axis);
@@ -97,10 +89,6 @@
1);
}
- //if((points[0][2] > 10 || points[1][2] > 10 || points[2][2] > 10|| points[3][2] > 10)){
- //}
-
-
}
void Rasturizer::drawAllFaces(Face *faceArray, int noOfCubes, float angle){
Face temp;
@@ -207,7 +195,6 @@
lcd.printString("Help",35,3);
lcd.drawRect(24, 22, 45, 10, FILL_TRANSPARENT);
-
lcd.drawRect(24, 38, 45, 10, FILL_WHITE);
lcd.printString("Quit",35,5);
lcd.drawRect(24, 38, 45, 10, FILL_TRANSPARENT);
@@ -217,8 +204,8 @@
faces[i] = selectionCube.getFace(i);
}
drawAllFaces(faces, 1, 0);
- selectionCube.rotateX(-0.1);
- selectionCube.rotateY(-0.05);
- selectionCube.rotateZ(0.08);
+ selectionCube.rotateX(-0.05);
+ selectionCube.rotateY(-0.025);
+ selectionCube.rotateZ(0.04);
selectionCube.translate(-x, -y, -z);
}
\ No newline at end of file