Chp18: Hard】的更多相关文章

18.1 Write a function that adds two numbers. You should not use + or any arithmetic operators. Solution: deal with 759 + 674. 1. add 759 + 674, but forget to carry. get 323 2. add 759 + 674, but only do the carrying, rather than the addition of each…
以2D表面为例展示纹理贴图,用opengl设置一个2D纹理,颜色存储在32*32*3的数组中,对应的纹理坐标为0<=s, t<=1.0. 画出几个正方形表面,分别以GL_CLAMP(纹理坐标大于1或小于0都被规范到1和0),GL_REPEAT(类似平铺,超过0或1的部分忽略整数位进行贴图),GL_MODULATE(纹理颜色与对象颜色相乘), GL_REPLACE(纹理颜色替换对象颜色)几种形式进行贴图. #include <GLUT/GLUT.h> GLsizei winWidht…