Skip to content
Snippets Groups Projects
Commit 90b6be6e authored by Taddeüs Kroes's avatar Taddeüs Kroes
Browse files

Graphics assignment 10

Added one last piece of comment
parent 30a5da0e
No related branches found
No related tags found
No related merge requests found
......@@ -165,6 +165,10 @@ createCylinder(polys * list, double radius, double height,
double len;
poly p;
int i;
// Calculate the vertical component of the texture coordinate, take the
// radius of the cylinder into account while doing this to prevent
// stretching
GLfloat tex_height = (GLfloat)(height / (2 * M_PI * radius));
// prepare poly datastructure, as these values are the same for all generated polys
......@@ -198,7 +202,7 @@ createCylinder(polys * list, double radius, double height,
p.normal[i].x /= len;
p.normal[i].z /= len;
// Set texture coordinate/
// Set texture coordinate
p.tcoord[i].x = (i < 2 ? longitude : longitude+10) / 360.0;
p.tcoord[i].y = (i == 1 || i == 2) ? tex_height : 0.0;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment