09 2017 档案
摘要:Given an array of 2n integers, your task is to group these integers into n pairs of integer, say (a1, b1), (a2, b2), ..., (an, bn) which makes sum of
阅读全文
摘要:Given two binary trees and imagine that when you put one of them to cover the other, some nodes of the two trees are overlapped while the others are n
阅读全文
摘要:Initially, there is a Robot at position (0, 0). Given a sequence of its moves, judge if this robot makes a circle, which means it moves back to the or
阅读全文
摘要:The Hamming distance between two integers is the number of positions at which the corresponding bits are different. Given two integers x and y, calcul
阅读全文
摘要:顶点着色器 首先我们需要定义一些顶点数据。OpenGL不是简单地把所有的3D坐标转换成屏幕上的2D像素。它只会把x,y,z在-1.0到1.0范围时才会处理。然后在标准化设备坐标范围内的坐标才会最终呈现在屏幕上。 由于我们需要绘制的是一个2D的三角形,所以我们把z值都设为0。 标准化设备坐标(Norm
阅读全文
摘要:在OpenGL中,一切事物都在3D空间中,但我们的屏幕坐标确实2D像素数组,OpenGL大部分工作就是把3D坐标转换成适应屏幕的2D像素。3D坐标转换成2D屏幕坐标的过程是有OpenGL的图形渲染管线管理的。图形渲染管线的工作可以被划分为两个主要的部分: 一、把3D坐标转换成2D坐标。 二、把2D坐
阅读全文
摘要:GLFW GLFW是一个OpenGL的C语言库,它提供了渲染物体所需要的最低限度的接口,它允许用户创建OpenGL上下文,定义窗口参数以及用户的输入。 构建GLFW GLFW可以从它的官方网站下载,目前官网上有Visual Studio2015及之前版本的预编译二进制版本和相应的头文件,我这里是下载
阅读全文
浙公网安备 33010602011771号