我刚刚开始使用GLUT处理OpenGL.下面的代码编译并显示两个线框立方体和一个球体.问题是,当我尝试拖动或调整窗口大小时,它会在跟踪鼠标之前产生明显的延迟.
我的同事的计算机上没有出现此问题,代码相同.
我在Windows 7计算机上使用Visual Studio 2012 c ++ express.我不是一个经验丰富的程序员.
// OpenGLHandin1.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <GL/glut.h>
void initView(int argc, char * argv[]){
//init here
glutInit(&argc, argv);
//Simple buffer
glutInitDisplayMode( GLUT_SINGLE | GLUT_RGBA );
glutInitWindowPosition(100,100);
glutInitWindowSize(800,400);
glutCreateWindow("Handin 2");
}
void draw(){
glClearColor(0,0,0,1);
glClear(GL_COLOR_BUFFER_BIT);
//Background color
glPushMatrix();
glLoadIdentity();
glTranslatef(0.6, 0, 0);
glColor3f(0.8,0,0);
glutWireCube(1.1); //Draw the cube
glPopMatrix();
glPushMatrix();
glLoadIdentity();
glTranslatef(-0.5, 0, -0.2);
glColor3f(0,0.8,0);
glutWireCube(1.1); //Draw the cube
glPopMatrix();
glPushMatrix();
glLoadIdentity();
glTranslatef(0, …Run Code Online (Sandbox Code Playgroud) 因此,当我尝试在TeamCity构建步骤(命令行构建步骤)中运行脚本文件时,我收到以下错误:
Step 1/8: Download provisioning profile (script file) (Command Line)
[12:23:07][Step 1/8] Starting: /Applications/TeamCity/buildAgent/work/83a21295522e711a/TeamCityCustomBuildScripts/DownloadProvisioningProfile.sh
[12:23:07][Step 1/8] in directory: /Applications/TeamCity/buildAgent/work/83a21295522e711a/Project
[12:23:07][Step 1/8] Cannot run process /Applications/TeamCity/buildAgent/work/83a21295522e711a/TeamCityCustomBuildScripts/DownloadProvisioningProfile.sh : file not found
[12:23:07][Step 1/8] Step Download provisioning profile (script file) (Command Line) failed with unexpected error
Run Code Online (Sandbox Code Playgroud)
我可以在构建步骤告诉我无法找到它的确切位置手动查找并运行脚本.
这可能有什么问题?
我试图在顶点数组对象(VAO)中使用两个顶点缓冲区对象(VBO)和两个索引缓冲区对象(IBO)来渲染包含3D模型的波前.Obj文件中的数据..obj文件使用顶点/正常面定义:
f v1//vn1 v2//vn2 v3//vn3
Run Code Online (Sandbox Code Playgroud)
我意识到我无法使用两个IBO来使用OpenGL的VAO进行索引,因为只有一个缓冲区对象(一次)可以绑定到GL_ELEMENT_ARRAY_BUFFER绑定目标.这意味着我不能只定义顶点位置索引和顶点法线索引,当我需要两者作为GLSL顶点着色器的输入时,这是一个问题.
我想过使用封装顶点位置和顶点法线的"顶点"结构,但我不知道如何将数据作为除了一个长数组之外的任何东西提供给我,并且当我将所有顶点位置数据放在不同的对象中时.我想我可以使用一些循环将数据复制到包含所有位置数据的新数组.
加载.obj文件时,我想我可以处理数据,以便法线与相应的顶点位置值匹配.
我该如何解决这个问题?
我正在使用C++和Visual Studio 2012与OpenGL 3.3.
我以前能够通过他们的REST API(https://support.hockeyapp.net/kb/api/api-apps#upload-app)将.ipa文件上传到HockeyApp网站.
现在,当我尝试上传时:
curl -F "status=2" -F "notify=1" -F "notes=Testing." -F "notes_type=0" -F "ipa=@hockeyapp.ipa" -H "X-HockeyAppToken: [Token, removed]" https://rink.hockeyapp.net/api/2/apps/upload
Run Code Online (Sandbox Code Playgroud)
我明白了:
curl: (43) A libcurl function was given a bad argument"
Run Code Online (Sandbox Code Playgroud)
该文件hockeyapp.ipa存在于当前工作目录中.
我在Mac OS X Sierra版本10.12.3上.