TextureBMP
11 | 12 |TextureBMP is sample C++ code illustrating the use of textures in 13 | OpenGL. It is intended to accompany the book 3D Computer Graphics: A 14 | mathematical approach with OpenGL, by S. Buss, Cambridge University Press, 15 | 2003. However, it can be used independently as well.
16 | 17 |TextureBMP reads a texture map from a bitmap file (.bmp 18 | extension). Bitmap files can be created with many standard graphics editting 19 | programs, include the PC program Paint. These programs often 20 | allow coverting other file formats to bitmap images. The main program is in TextureMap.cpp. 21 | The C++ class RgbImage is used to read the image data 22 | from a bitmap file.
23 | 24 |There are several options for downloading the files. 25 | 26 |
Things to look at: 39 | 40 |
54 | 55 | 56 | -------------------------------------------------------------------------------- /challenge7/example/TextureBMP.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mejibyte/computer_graphics_challenges/b99c4b10582d14ef2d52f2bb676784c4493829b1/challenge7/example/TextureBMP.zip -------------------------------------------------------------------------------- /challenge7/pack/README.txt: -------------------------------------------------------------------------------- 1 | Challenge 7 - Andrés Mejía 2 | ========================== 3 | 4 | Like challenge 6 (create a robotic arm in OpenGL with 3 articulations and lighting) but add textures. 5 | 6 | * The shoulder should rotate around the Y and Z axes. 7 | * The elbow should rotate around the Z axis. 8 | * The wrist should rotate around the X and Z axes. 9 | 10 | Run it yourself 11 | --------------- 12 | 13 | These instructions are for Mac OS X. Your mileage may vary. 14 | 15 | cd challenge7/src 16 | g++ RgbImage.cpp main.cpp -framework GLUT -framework OpenGL -o arm 17 | ./arm 18 | 19 | On the window that appears, press: 20 | 21 | * `q` and `a` to increase or decrease the angle of rotation around the Y axis at the shoulder. 22 | * `w` and `s` to increase or decrease the angle of rotation around the Z axis at the shoulder. 23 | * `e` and `d` to increase or decrease the angle of rotation around the Z axis at the elbow. 24 | * `r` and `f` to increase or decrease the angle of rotation around the Z axis at the wrist. 25 | * `t` and `g` to increase or decrease the angle of rotation around the X axis at the wrist. 26 | * `↑` and `↓` to increase or decrease the camera's distance to the object. 27 | * `←` and `→` to increase or decrease the camera's angle of rotation around the Z axis. 28 | 29 | Screenshots 30 | ----------- 31 | 32 | See /shots. 33 | 34 | Source code 35 | ----------- 36 | 37 | Available at https://github.com/andmej/computer_graphics_challenges. -------------------------------------------------------------------------------- /challenge7/pack/reto7.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mejibyte/computer_graphics_challenges/b99c4b10582d14ef2d52f2bb676784c4493829b1/challenge7/pack/reto7.zip -------------------------------------------------------------------------------- /challenge7/pack/shots/Screen shot 2011-10-19 at 20.19.57.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mejibyte/computer_graphics_challenges/b99c4b10582d14ef2d52f2bb676784c4493829b1/challenge7/pack/shots/Screen shot 2011-10-19 at 20.19.57.png -------------------------------------------------------------------------------- /challenge7/pack/shots/Screen shot 2011-10-19 at 20.20.24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mejibyte/computer_graphics_challenges/b99c4b10582d14ef2d52f2bb676784c4493829b1/challenge7/pack/shots/Screen shot 2011-10-19 at 20.20.24.png -------------------------------------------------------------------------------- /challenge7/pack/shots/Screen shot 2011-10-19 at 20.20.31.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mejibyte/computer_graphics_challenges/b99c4b10582d14ef2d52f2bb676784c4493829b1/challenge7/pack/shots/Screen shot 2011-10-19 at 20.20.31.png -------------------------------------------------------------------------------- /challenge7/pack/shots/Screen shot 2011-10-19 at 20.20.35.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mejibyte/computer_graphics_challenges/b99c4b10582d14ef2d52f2bb676784c4493829b1/challenge7/pack/shots/Screen shot 2011-10-19 at 20.20.35.png -------------------------------------------------------------------------------- /challenge7/pack/shots/Screen shot 2011-10-19 at 20.20.43.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mejibyte/computer_graphics_challenges/b99c4b10582d14ef2d52f2bb676784c4493829b1/challenge7/pack/shots/Screen shot 2011-10-19 at 20.20.43.png -------------------------------------------------------------------------------- /challenge7/pack/shots/Screen shot 2011-10-19 at 20.21.07.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mejibyte/computer_graphics_challenges/b99c4b10582d14ef2d52f2bb676784c4493829b1/challenge7/pack/shots/Screen shot 2011-10-19 at 20.21.07.png -------------------------------------------------------------------------------- /challenge7/pack/shots/Screen shot 2011-10-19 at 20.21.13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mejibyte/computer_graphics_challenges/b99c4b10582d14ef2d52f2bb676784c4493829b1/challenge7/pack/shots/Screen shot 2011-10-19 at 20.21.13.png -------------------------------------------------------------------------------- /challenge7/pack/shots/Screen shot 2011-10-19 at 20.21.26.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mejibyte/computer_graphics_challenges/b99c4b10582d14ef2d52f2bb676784c4493829b1/challenge7/pack/shots/Screen shot 2011-10-19 at 20.21.26.png -------------------------------------------------------------------------------- /challenge7/pack/shots/Screen shot 2011-10-19 at 20.21.33.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mejibyte/computer_graphics_challenges/b99c4b10582d14ef2d52f2bb676784c4493829b1/challenge7/pack/shots/Screen shot 2011-10-19 at 20.21.33.png -------------------------------------------------------------------------------- /challenge7/pack/shots/Screen shot 2011-10-19 at 20.21.38.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mejibyte/computer_graphics_challenges/b99c4b10582d14ef2d52f2bb676784c4493829b1/challenge7/pack/shots/Screen shot 2011-10-19 at 20.21.38.png -------------------------------------------------------------------------------- /challenge7/pack/shots/Screen shot 2011-10-19 at 20.21.41.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mejibyte/computer_graphics_challenges/b99c4b10582d14ef2d52f2bb676784c4493829b1/challenge7/pack/shots/Screen shot 2011-10-19 at 20.21.41.png -------------------------------------------------------------------------------- /challenge7/pack/shots/Screen shot 2011-10-19 at 20.21.46.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mejibyte/computer_graphics_challenges/b99c4b10582d14ef2d52f2bb676784c4493829b1/challenge7/pack/shots/Screen shot 2011-10-19 at 20.21.46.png -------------------------------------------------------------------------------- /challenge7/pack/shots/Screen shot 2011-10-19 at 20.21.54.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mejibyte/computer_graphics_challenges/b99c4b10582d14ef2d52f2bb676784c4493829b1/challenge7/pack/shots/Screen shot 2011-10-19 at 20.21.54.png -------------------------------------------------------------------------------- /challenge7/pack/shots/Screen shot 2011-10-19 at 20.22.05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mejibyte/computer_graphics_challenges/b99c4b10582d14ef2d52f2bb676784c4493829b1/challenge7/pack/shots/Screen shot 2011-10-19 at 20.22.05.png -------------------------------------------------------------------------------- /challenge7/pack/shots/Screen shot 2011-10-19 at 20.22.32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mejibyte/computer_graphics_challenges/b99c4b10582d14ef2d52f2bb676784c4493829b1/challenge7/pack/shots/Screen shot 2011-10-19 at 20.22.32.png -------------------------------------------------------------------------------- /challenge7/pack/src/RgbImage.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * RayTrace Software Package, release 1.0.4, February 2004. 4 | * 5 | * Author: Samuel R. Buss 6 | * 7 | * Software accompanying the book 8 | * 3D Computer Graphics: A Mathematical Introduction with OpenGL, 9 | * by S. Buss, Cambridge University Press, 2003. 10 | * 11 | * Software is "as-is" and carries no warranty. It may be used without 12 | * restriction, but if you modify it, please change the filenames to 13 | * prevent confusion between different versions. Please acknowledge 14 | * all use of the software in any publications or products based on it. 15 | * 16 | * Bug reports: Sam Buss, sbuss@ucsd.edu. 17 | * Web page: http://math.ucsd.edu/~sbuss/MathCG 18 | * 19 | */ 20 | 21 | #pragma once 22 | 23 | #include