Catmull–Clark subdivision surface/C: Difference between revisions

m
Fixed syntax highlighting.
(tweaks for better display)
m (Fixed syntax highlighting.)
 
(2 intermediate revisions by 2 users not shown)
Line 1:
{{libheader|GLUT}}
Full C code, OpenGL program. Looooong. Keybindings of interest: '<' and '>' for subdivision steps; 'w' toggles wireframe mode; arrow keys and space for rotation; 'm' for switching models; misc keys: p, l, a, z, s, p, q.
<langsyntaxhighlight lang="c">#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Line 562 ⟶ 563:
else glColor3fv(color);
 
glBegin(GL_LINEGL_LINES);
glVertex3fv(&(e->v[0]->pos.x));
glVertex3fv(&(e->v[1]->pos.x));
Line 762 ⟶ 763:
 
return 0;
}</langsyntaxhighlight>
9,482

edits