我应该写一些haskell程序,但我真的不知道从哪里开始.如果你能给我一些资源来阅读或解释我的问题,我将非常感激.我确信这是一个非常业余的东西,但我真的需要一个起点.
data DFA q o = DFA (q -> o -> q) q [q]
data NFA q o = NFA (q -> o -> [q]) [q] [q]
-- I really realy don't understand the declarations here
-- I can guess that q is somewhat related to Q and o to E, but don't get what it really means
data Q = Q0 | Q1 | Q2
deriving (Eq, Enum, Bounded)
data E = A | B
-- what does n1 …Run Code Online (Sandbox Code Playgroud) 有人可以解释如何为三角形网格生成索引吗?
该程序为球体对象生成顶点数组,并生成索引以使用glDrawElements方法绘制.
我不明白这些索引如何与堆栈和切片相关.
我是openGL的新手,我花了很多时间试图理解这段代码是如何工作的.
提前致谢.:)
int stacks = 40, slices = 40; // stacks = no. of Latitude lines,
// slices = no. of Longitude lines
double deltaLong = PI * 2 / slices;
double deltaLat = PI / stacks;
// Generate vertices coordinates, normal values, and texture coordinates
numVertices = (slices + 1) * (stacks - 1) + 2;
vertices = new float[numVertices * 3];
normals = new float[numVertices * 3];
textures = new float[numVertices * 2];
// North …Run Code Online (Sandbox Code Playgroud)