登录
首页 » Android » 编码的 3D 游戏

编码的 3D 游戏

于 2022-07-02 发布 文件大小:10.14 MB
0 145
下载积分: 2 下载次数: 1

代码说明:

3D 培训 我写的 3D 游戏培训编程 glUseProgram(m_programSkyBox.Program); glGenBuffers(1, &skyBoxVertexBuffer); glBindBuffer(GL_ARRAY_BUFFER, skyBoxVertexBuffer); float vertices[24] = { -1.0, -1.0, 1.0, 1.0, -1.0, 1.0, -1.0, 1.0, 1.0, 1.0, 1.0, 1.0, -1.0, -1.0, -1.0, 1.0, -1.0, -1.0, -1.0, 1.0, -1.0, 1.0, 1.0, -1.0, }; glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW); glGenBuffers(1, &skyBoxIndexBuffer); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, skyBoxIndexBuffer); GLubyte indices[14] = {0, 1, 2, 3, 7, 1, 5, 4, 7, 6, 2, 4, 0, 1}; 绘图 skybox: glClearColor(0.5f, 0.5f, 0.5f, 1); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glUseProgram(m_programSkyBox.Program); glDisable(GL_DEPTH_TEST); // skybox should be drawn behind anything else glBindTexture(GL_TEXTURE_CUBE_MAP, m_textures.Cubemap); glBin

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • 696518资源总数
  • 105877会员总数
  • 14今日下载