CS 330 Lecture 17 – Callbacks and Parsing with ANTLR
Agenda one more thing on C function pointers: callbacks http://www.opengl.org/resources/libraries/glut/spec3/node46.html http://www.opengl.org/resources/libraries/glut/spec3/node54.html#SECTION00089000000000000000 program this the translation process: lexing, parsing, generating ANTLR v4 why write our own languages and parsers? TODO Read chapter 2 through section 2.1. Walk through http://www.antlr.org/wiki/display/ANTLR4/Getting+Started+with+ANTLR+v4. Quarter sheet. Program This Code torus.c Divs.g4 messy.txt PrettyPrinter.java Haiku
CS 455 Lecture 12 – Specular and Texture
Before Class Texture Watch http://youtu.be/xvML4htJAVU. Read chapter 4, sections Introduction through Applying a 2-D Texture, pages 105-110. Specular Watch http://youtu.be/EM4x35haH7c. Read chapter 2, section Implementing Per-Vertex ADS Shading, pages 55-62. Read chapter 3, sections Using Per-fragment Shading… through Using the Halfway Vector…, pages 88-93. In Class Augment your maze renderer from last class with a shiny texture: […]
CS 330 Lecture 16 – Polymorphism in C, Higher-order Functions
Agenda what ?s answer this! polymorphism in C through unions higher-order functions in C TODO Rest. Answer This! Code makefile Note to copy and pasters: makefile rules need to be indented with real tabs, not spaces. stack.h stack.c names.c sorters.c Haiku
CS 455 Lecture 11 – Perspective and Camera
Before Class Perspective Watch http://youtu.be/k3dhGlAx_DA. For another perspective, read http://www.songho.ca/opengl/gl_projectionmatrix.html. Camera Watch http://youtu.be/-c62eQ_QpBE. For a similar implementation, read http://ogldev.atspace.co.uk/www/tutorial13/tutorial13.html. In Class It’s time to test out that perspective projection with long corridors. Your task in this class is to code up a maze traverser. Grab the maze.obj file in W455. The entrance to the maze starts roughly at (0, […]
CS 330 Lecture 15 – Makefiles, For Real
Agenda what ?s the need for separate compilation the way to manage separate compilation: make polymorphism in C: unions TODO Write a midterm exam question on something you read or something discussed in lecture. Turn it in on a quarter sheet. Some portion of the upcoming midterm will be comprised of your questions. In addition […]
CS 455 Lecture 10 – Terrain and the Diamond Square Algorithm
Before Class Terrain and the Diamond Square Algorithm Watch http://youtu.be/WqnEnkx_svM. Read http://www.gameprogrammer.com/fractal.html. In Class It’s a work day.
CS 330 Lecture 14 – Postfix Calculator and Make
Agenda what ?s hw2 grading script ready and untested program this! making stack reusable managing compilation with make TODO Read section 8.3 in your book. Quarter sheet. On the valgrind logo: http://valgrind.org/gallery/artwork.html. Program This Code strappend.c stack.c stack.h stack_user.c Haiku
CS 330 Lecture 13 – Data Structures in C, Make
Agenda what ?s riddle variable-length arrays distinct ideas: memory is addressable heap memory can be allocated dynamically generating stereo tones pointer arithmetic a stack data structure without classes typedef separate compilation and header files a postfix calculator managing separate compile with make Variable-length Arrays The C99 standard allows arrays whose sizes are only known at […]
CS 455 Lecture 9 – Trackball Interface and Lighting++
Before Class Trackball Interface Watch http://youtu.be/CT1WO7gTls4. Read http://www.opengl.org/wiki/Trackball. Lighting++ Browse https://www.google.com/search?q=cel+shading+opengl&tbm=isch. Watch http://youtu.be/urgJXkjyVIU. Read pages 50-54 and 97-100 in your book. In Class Implement per-fragment toon shading using a positional light source. Use the right-mouse button to place the light source on a virtual sphere centered over your viewport. If you have time, use the left-mouse button to apply trackball […]
CS 330 Lecture 12 – Malloc, Classless Data Structures, and Make
Agenda what ?s what does this do? two primary reasons for heap storage: functions can return data cheaply memory needs not always known at compile time an EZMALLOC macro aplay -c 2 -f S16_LE -r 22050 file pointer arithmetic fopen, fwrite, fclose a stack API the need for separate compilation and header files makefiles What […]