Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
uva
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Taddeüs Kroes
uva
Commits
90b6be6e
Commit
90b6be6e
authored
Nov 29, 2010
by
Taddeüs Kroes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Graphics assignment 10
Added one last piece of comment
parent
30a5da0e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
graphics/ass10/geometry.c
graphics/ass10/geometry.c
+5
-1
No files found.
graphics/ass10/geometry.c
View file @
90b6be6e
...
...
@@ -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
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment