OpenGl写个动画为何会卡住?急求!!!!!!!!!!!!!!!!!

void CMFCopengl2Dlg::draw1(){
CPaintDC dc1(this);
do
{
Sleep(50);
glBegin(GL_LINE_STRIP);
glColor3f(0.0, 0.7, 1.0);
glVertex2f(510, 400);
glVertex2f(510, 400 - i);
i = i + 10;
glEnd();
//dwEnd = GetTickCount() - dwStart;
glFlush();
SwapBuffers(dc1);
} while (i < 200);

}

1个回答

shader问题?有木有报错之类的啊.

qq_26470013
skyblue_2012 这个没有报错,只是卡住了,做不了别的事
3 年多之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
为何SendMessage会卡住?
在工作线程中用SendMessage给主窗口发消息但是就卡在这里了rn在消息处理这里设了断点 发现主窗口根本就没收到消息rnrn哪位兄弟知道为何会卡住?消息是自定义的WM_USER+10
VC++6.0 OPENGL动画实现方法!急求!
本人毕业设计需要使用opengl制作动画,不知如何实现动画,请高人指教!rn先给出一个一条线段示例,起始点是(0,0,0),终点是(5000+x,5000+y,5000+z)rn现在需要做一个简单动画如下表表示:rnrn时间(s) 0.1 0.2 0.3 .... 假设到2秒为止rn x 100 200 300 .... rn y 100 200 300 ....rn z 100 200 300 ....rnrn下面是这条线段的代码,希望有高人能在这段代码的基础上帮我添加实现动画的语句,谢谢!rnrn#include rn#include rn#include rn#include rnrnfloat x=0;rnfloat y=0;rnfloat z=0;rnrnvoid model(void) rnrnglClear(GL_COLOR_BUFFER_BIT);rnglMatrixMode(GL_MODELVIEW);rnglLoadIdentity();rngluLookAt(-100,-100,40,100,0,0,0,0,100);rnglLineWidth(1);rnglBegin(GL_LINES);//坐标轴rn glColor3f(1,1,1);rn glVertex3f(0,0,0);//X轴rn glVertex3f(100000,0,0);rn glVertex3f(0,0,0); //Y轴rn glVertex3f(0,100000,0);rn glVertex3f(0,0,0);//Z轴rn glVertex3f(0,0,100000);rnglEnd();rnrnglLineWidth(5);rnglBegin(GL_LINES);rn glColor3f(0,1,1);rn glVertex3f(0,0,0); rn glVertex3f(5000+x,5000+y,5000+z);rnglEnd();rnrnglFlush();rnrnrnrnvoid reshape(int w,int h)rnrn glViewport(0,0,w,h);rn glMatrixMode(GL_PROJECTION);rn glLoadIdentity();rn glOrtho(-15000,15000,-10000,20000,-30000,30000);rnrnrnvoid init()rnrn glClearColor(1.0,1.0,1.0,1.0);rn glColor3f(0.0,0.0,0.0);rnrnrnint main(int argc, char *argv[]) rnrnglutInit(&argc, argv);rnglutInitDisplayMode(GLUT_RGB | GLUT_SINGLE);rnglutInitWindowPosition(200,100);rnglutInitWindowSize(600,600);rnglutCreateWindow("DESIGN");rnglutReshapeFunc(reshape);rnglutDisplayFunc(&model);rnglutMainLoop();rninit();rnreturn 0;rnrn
求帮忙写个Silverlight动画
如题[img=https://img-bbs.csdn.net/upload/201407/04/1404462348_724966.png][/img]rn这个条 上面的文字 是从右向左 移动的 rn我整了好久都没整出来 rn我写的动画 运行之后 占用Cpu50% 求大神写个高效点的
Tomcat为何卡住??
如题,请教rn我的tomcat起来之后,在页面上点几次链接,tomcat就卡住了,浏览器一直处于等待状态,控制台无任何异常rnrn我换了个tomcat之后,还是这样。rnrn所以我怀疑是我的应用的问题。rnrn静态页面,jsp等都正常。rnrn应用里面有struts,hibernate,spring.rnrn请问,找这个问题我应该从哪里下手?
QEventLoop会卡住的解决方法
问题是这样的:在一个线程中有下面一段代码QEventLoop loop; QObject::connect(this, SIGNAL(playStopped()), &loop, SLOT(quit())); loop.exec();在主界面的线程中,HSSettings是一个QDialog类HSSettings* settings = new HSettings(this); settings->
浮动元素为什么会卡住???
rnrnrn 浮动元素卡住rnrnrn rn rn rn rn rnrnrn [img=http://pic002.cnblogs.com/images/2012/391172/2012071710393059.jpg][/img]rn为什么蓝色区域不在绿色的下面?下面的红色为什么也不能在绿色的下面?
联接SQLserver2000会卡住
如果服务器未启动,连接SQLserver2000查询时,界面会卡住,放在线程中,也不行.不知有什么办法不让程序冻结.
CHttpFile SendRequest 会卡住
这个 SendRequest 会卡住,到底怎么办的??哪位兄弟遇到过 给个解决方案吧。。。。。。
为什么webclient会卡住 ?
先向一个不存在的1.php发了两次head请求,然后再向baidu.com发送了一个GET请求, 这时就卡住 了。rn如果我改成只向1.php发一次HEAD请求,后面的那个GET不会被卡住 ,这是为什么?rnrnrn[code=C#]Result rs = Request.Head("http://www.baidu.com/1.php");rnResult rs1 = Request.Head("http://www.baidu.com/1.php");rnMessageBox.Show(Request.mkRequest("http://www.baidu.com/", "get", null, "gbk")); //在这句的时候,卡死了。rn//如果我只向1.php发一送head请求,这里就不会卡住 ,或者把这个get改成www.sina.com,也不会卡住 。rn[/code]rnrnRequest.Head方法:rn[code=C#] public static Result Head(String url) rn //WebHeaderCollection headers = null;rn Result rs = new Result();rn HttpWebRequest request = WebRequest.Create(url) as HttpWebRequest;rn request.Timeout = 5000;rn WebResponse response = null;rn // instruct the server to return headers only rn request.Method = "HEAD";rn // make the connection rn tryrn rn response = request.GetResponse() as HttpWebResponse;rn rs.Status = 200;rn rn catch (WebException ex) rn response = ex.Response;rn rs.Status = 500;rn if (response == null) rn rs.ContentLength = 0;rn return rs;rn rn rn rn // get the headers rn //headers = response.Headers;rnrn tryrn rn rs.ContentLength = int.Parse(response.Headers[HttpResponseHeader.ContentLength]);rn rn catch ( Exception e) rn rs.ContentLength = 0;rn rn rn return rs;rn [/code]rnrnRequest.mkRequest方法:rn[code=C#]public static String mkRequest(String url, String method, String data, string encode)rn rn WebClient wc = new WebClient();rn wc.Credentials = CredentialCache.DefaultCredentials;rn Encoding enc = Encoding.GetEncoding(encode); rn string s = null;rn tryrn rn Byte[] pageData = wc.DownloadData(url);rn s = enc.GetString(pageData);rn rn catch (WebException exp)rn rn WebResponse wr = exp.Response;rn StreamReader esr = new StreamReader(wr.GetResponseStream(), ASCIIEncoding.Default);rn s = (esr.ReadToEnd());rn esr.Close();rn rn return s;rn [/code]
vb.net下载会卡住
rt,我用的是DownloadFile,一按下载就会卡在,要等下载好才恢复正常
OpenGL的动画
rn我的动画是这样实现的:rnm_nTimer = SetTimer(1, 0.1, NULL); rnangle = fmod(angle,360) + 0.3f; rnrnangle表示图片旋转的角度。rn结果大致看起来还可以,就是有时停滞。rn其中一个问题就是SetTimer中的时间只有0.1,旋转角度每次只有0.3f,是不是太太小了?rnrn3X
OpenGL 动画
一直有一个疑问,自己用OpenGL做的各种显示效果总是觉得不够逼真,但是看电视里边的动画片都觉得特别漂亮。可以肯定的说,我的OpenGL没有学精,但是除了这个还有别的原因吗?动画仿真一般采用的都是什么技术呀?有懂的吗,需要解惑。。。
opengl动画
delphi读取3Dmax文件,纹理贴图等。对初学opengl有帮助。
OPENGL动画
OPENGL动画效果,3d效果,动画
OpenGL动画
使用c++6.0做的关于计算机图形学的动画
求大家写个查询语句,急!!!!
有6个表,分别是:rn表一:yxjgb rn表项有:机构代号 jgdh 机构名称 jgmc rn表二: dshqzwj rn表项有: 机构代号 jgdh 账户余额 zhye 账号 zhdh rn表三: client_ref rn表项有:业务类型 Classno 账号 zhdh 贷款金额 factcorpus 合同号 bargainno rn表四: client_listrn表项有:还款状态 status 合同号 bargainnorn表五:person_ref rn表项有:合同号 bargainno 客户号 clientnorn表六:person_infrn表项有:客户号 clientno 姓名 name 手机 mobile 电话 tel 贷款余额 banlance 当月还款额 supplyrn查询条件为:rn1:业务类型 即Classno=152rn2:还款状态 即status =0或者status =2rn3:账户余额 〈 当月还款额 即zhye
canvas圆盘写个动画
继上一篇文章,一个圆盘写个动画比较容易。一个数组圆盘然后给每一个圆盘写一个动画就比较难了。很烦,封装的很有问题。之前的draw函数写的有很大问题。不应该把foreach写在里面。导致不同的圆盘动画会被影响。应该是每一个圆盘给他一个独立的对象,之间互不影响。不然后面改变他的值就会有问题。现在是这么个东西。算是记录一回吧。现在是这么个效果。 change函数 DrawDisk.prototype....
急求会用OpenGL做3D动画的人!!!!!!!
有没有OpenGL的高手啊?rn需要做一个30-60秒的3D动画,要有一定的情节rn基本框架已经做好,只需要添加动画内容(人物或动物,天空,地面等)rn会的话请联系我rnQQ:22321050
打开视频聊天室会卡住?????
我是2000 sp4的系统,为什么打开视频聊天室会卡住,曾经有一个对话框提示说 programme manager 停止响应,有没发生和我同一情况的高手指点下,高人请指教~~~~~~~
求大牛给我写个DLL (急求!!!)
急求一个DLL,DLL里面连表 delphi自带的DB。rn读取一张表里的数据。然后返回结果集, 给别的程序调用。rn rn 大牛,大虾救我,急求代码!! rnrn或者有别的返回表的内容的方法,也求大牛教我。rnrnrn
写个拍照示例程序也会被卡住,求助
surfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);rnSDK上貌似说会自动设置, 不用特意调用这个方法了。但我不调用它,预览就显示不了了。rnrn不知是不是设置成了这个Type就不能按常规那样在Canvas上画布了,也不知这个Type是不是此后者不能再修改了。rn我是想拍照后,stopPreview() ,然后把拍的照片直接显示在预览用的SurfaceView上rn但Canvas canvas = surfaceHolder.lockCanvas();总是失败的。rnrn04-12 12:09:21.917: ERROR/Surface(6123): Surface (identity=2206) requestBuffer(0, 00000033) returneda buffer with a null handlernrn04-12 12:09:21.917: ERROR/Surface(6123): getBufferLocked(0, 00000033) failed (Out of memory)rnrn04-12 12:09:21.917: ERROR/Surface(6123): dequeueBuffer failed (Out of memory)rnrn04-12 12:09:21.964: ERROR/SurfaceHolder(6123): Exception locking surfacernrn04-12 12:09:21.964: ERROR/SurfaceHolder(6123): android.view.Surface$OutOfResourcesExceptionrn
为什么添加字段会卡住
我用的mssql2005 rnrn我在测试库里执行一条 添加字段的语句 ,然后update一个默认值 char 1rnrn后来在正式库执行这条语句时就直接卡住,不知道是不是因为很多人在链接这个数据库,rnrn软件是hr系统,公司hr部门啊 考勤啊 订餐啊都有在用。 rnrn同事说要停掉sql服务 在重启后 立即更新。rnrn不懂这是什么情况。是资源被占用不能更新,还是什么 求解答
急问一个OpenGL动画难题
本人现在在做公路的模拟漫游程序,目的是要模拟司机的视点在道路上行驶。已知道路的中线三维坐标(每隔一米为一段面),我构造了结构sect将整条道路的所有断面的数据都读入了,从而生成了一个链表。表头为head.rn在模拟司机视线的时候,采用了gluLookAt()函数,并定义了一个当前视点变量:sect *nowsect。其中nowsect.x,nowsect.y,nowsect.z为gluLookAt()中的视点,然后在OnTimer()函数中:nowsect = nowsect->next,再通过设定SetTimer()不断刷新来改变当前视点。rn问题在于:本人是在工程的Doc类中生成原始链表的,而画图是在View类中的draw()函数中进行。因此在draw()函数中的开头不得不令nowsect = head,让视点从道路的起点开始。所以当每次SetTimer()函数向系统发送WM_TIMER消息时,draw()函数每次重绘实际上都没改变nowsect的值,它始终都是指向head.这个问题始终没得到解决。rn我看别的动画例子是将动画变量在View类中的构造函数中赋初值,但当我在构造函数中对nowsect赋初值时却出现了内存错误。我是这样对nowsect赋初值的:rn CAutoRoadDoc* pDoc = GetDocument();rn nowsect = pDoc->head;rn我不知道哪里错了,请高手指点。或者还可以有什么别的方法解决我的问题?
VC实现openGL动画-急!高手帮忙
这个程序应该是输出一个动画,但是我按照这个程序仅仅输出以下图片(http://www.pedsurg.cn/image/member/1146217140.jpg),不能达到动画目的。请高手帮忙。环境:VC++6.0。源程序:rn#includern#includern#includernrn#includern#includern#includernrn#define SWING 1rn#define BAR 2rnrnvoid CALLBACK reshape(int width,int height);rnvoid CALLBACK draw(void);rnrnGLfloat angle; //angle of swingrnint direction; //direction of swingrnrnvoid CALLBACK reshape(int width,int height)rn //set the new viewport sizern glViewport(0,0,(GLint)width,(GLint)height);rnrn //choose the projection matrix to be the matrixrn //manipulated by the following callsrn glMatrixMode(GL_PROJECTION);rn rn glLoadIdentity();rnrn glOrtho(-50.0,50.0,-50.0,50.0,-150.0,150.0);rn //Choose the modelview matrix to be the matrixrn //manipulated by further callsrn glMatrixMode(GL_MODELVIEW);rnrnvoid CALLBACK draw(void)rn glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);rn glLoadIdentity();rn glRotatef(60.0,0.0,1.0,0.0);rn glCallList(BAR);rnrn glTranslatef(0.0,30.0,0.0);rn glRotatef(angle,1.0,0.0,0.0);rn glTranslatef(0.0,-30.0,0.0);rnrn glCallList(SWING);rnrn glFlush();rn auxSwapBuffers();rnrn if (direction==1)rn angle++;rn else rn angle--;rn if (angle==-40.0)rn direction=1;rn rn if (angle==40.0)rn direction=0;rn rnrnrnvoid make_bar()rn glNewList(BAR,GL_COMPILE);rn glBegin(GL_QUADS);rn glColor3f(1.0,1.0,0.0);rn //Bottomrn glVertex3d(-50,30,-1);rn glVertex3d(50,30,-1);rn glVertex3d(50,30,1);rn glVertex3d(-50,30,1);rn //Toprn glVertex3d(-50,33,-1);rn glVertex3d(50,33,-1);rn glVertex3d(50,33,1);rn glVertex3d(-50,33,1);rnrn glColor3f(1.0,0.65,0.0);rn //Frontrn glVertex3d(-50,33,1);rn glVertex3d(-50,30,1);rn glVertex3d(50,30,1);rn glVertex3d(50,33,1);rn //backrn glVertex3d(50,33,-1);rn glVertex3d(50,30,-1);rn glVertex3d(-50,30,-1);rn glVertex3d(-50,33,-1);rnrn glColor3f(1.0,0.0,0.0);rn //Leftrn glVertex3d(-50,33,-1);rn glVertex3d(-50,30,-1);rn glVertex3d(-50,30,1);rn glVertex3d(-50,33,1);rn //Rightrn glVertex3d(50,33,1);rn glVertex3d(50,30,1);rn glVertex3d(50,30,-1);rn glVertex3d(50,33,-1);rn glEnd();rnrn glEndList();rnrnvoid make_swing()rn glNewList(SWING,GL_COMPILE);rn glColor3f(1.0,0.0,1.0);rn glLineWidth(5.0);rnrn glBegin(GL_LINES);rn glVertex3d(-20,30,0);rn glVertex3d(-20,-30,0);rn glVertex3d(20,30,0);rn glVertex3d(20,-30,0);rn glEnd();rnrn glColor3f(0.0,1.0,0.0);rn glBegin(GL_QUAD_STRIP);rn glVertex3d(20,-30,-10);rn glVertex3d(20,-33,-10);rn glVertex3d(-20,-30,-10);rn glVertex3d(-20,-33,-10);rn glVertex3d(-20,-30,10);rn glVertex3d(-20,-33,10);rn glVertex3d(20,-30,10);rn glVertex3d(20,-33,10);rn rn glVertex3d(20,-30,-10);rn glVertex3d(20,-33,-10);rn glEnd();rnrn glColor3f(0.0,0.0,1.0);rnrn glBegin(GL_QUADS);rn glVertex3d(-20,-33,-10);rn glVertex3d(20,-33,-10);rn glVertex3d(20,-33,10);rn glVertex3d(-20,-33,10);rnrn glVertex3d(-20,-30,-10);rn glVertex3d(20,-30,-10);rn glVertex3d(20,-30,10);rn glVertex3d(-20,-30,10);rn glEnd();rnrn glEndList();rnrnrnvoid main(int argc,char **argv)rn auxInitPosition(0,0,500,500);rn auxInitDisplayMode(AUX_RGB|AUX_DEPTH|AUX_DOUBLE);rn auxInitWindow("Swing");rn glClearColor(0.0,0.0,0.0,0.0);rn glShadeModel(GL_FLAT);rn glPolygonMode(GL_FRONT_AND_BACK,GL_FILL);rn glEnable(GL_DEPTH_TEST);rnrn make_bar();rn make_swing();rnrn angle=-39.0;rn direction=1;rn auxReshapeFunc(reshape);rn auxMainLoop(draw);rn auxIdleFunc(draw);rn
求在opengl动画里显示fps的原码
求在opengl动画里显示fps的原码
求生成贝塞尔曲线过程的动画的opengl代码
4个控制点的生成动画就可以谢谢
急求会使用MAXScript编写动画的人员(有酬谢)
求会使用MAXScript编写动画的人员rn会的请加我rnQQ:815359049rn
Android初学 急求为何?
package com.misoo.ex01;rnrnimport android.app.Activity;rnimport android.content.Intent;rnimport android.graphics.Color;rnimport android.os.Bundle;rnimport android.view.View;rnimport android.view.View.OnClickListener;rnimport android.widget.Button;rnimport android.widget.LinearLayout;rnrnpublic class Ex01 extends Activityrnrn private final int WC = LinearLayout.LayoutParams.WRAP_CONTENT;rn private LinearLayout layout;rn private int mColor = Color.YELLOW;rn private LinearLayout.LayoutParams lParams;rn static final int RG_REQUEST = 0;rn /** Called when the activity is first created. */rn @Overridern public void onCreate(Bundle savedInstanceState) rn rn super.onCreate(savedInstanceState);rn layout = new LinearLayout(this);rn layout.setOrientation(LinearLayout.VERTICAL);rn lParams = new LinearLayout.LayoutParams(230, 140);rn DrawView drawView= new DrawView(this);rn layout.addView(drawView, lParams);rn rn Button button = new Button(this);rn button.setText("Change Color");rn button.setOnClickListener(new OnClickListener()rn rn rn @Overridern public void onClick(View arg0)rn rn Intent intent = new Intent(Ex01.this, RgActivity.class);rn startActivityForResult(intent, RG_REQUEST);rn rn );rn rn lParams = new LinearLayout.LayoutParams(WC, WC);rn layout.addView(button, lParams);rn rn setContentView(layout);rn rn rn public int getColor()rn rn return mColor;rn rn rn @Overridern protected void onActivityResult(int requestCode, rn int resultCode, Intent data)rn rn if (requestCode == RG_REQUEST)rn rn if (resultCode == RESULT_CANCELED)rn rn setTitle("Canceled...");rn rn else if (resultCode == RESULT_OK)rn rn String dataString = (String) data.getCharSequenceExtra("DataKey");rn setTitle(dataString);rn if (dataString.contains("Y"))rn rn mColor = Color.YELLOW;rn rn elsern rn mColor = Color.BLUE; rn rn rn rn rnrnrnrn[color=#993366]package com.misoo.ex01;rnrnimport android.app.Activity;rnimport android.content.Intent;rnimport android.os.Bundle;rnimport android.widget.RadioButton;rnimport android.widget.RadioGroup;rnimport android.widget.RadioGroup.OnCheckedChangeListener;rnrnpublic class RgActivity extends Activity implements OnCheckedChangeListenerrnrn private final int WC = RadioGroup.LayoutParams.WRAP_CONTENT;rn private RadioGroup radioGroup;rn RadioGroup.LayoutParams rParams;rn rn @Overridern public void onCreate(Bundle bundle)rn rn super.onCreate(bundle);rn radioGroup = new RadioGroup(this);rn rParams = new RadioGroup.LayoutParams(WC, WC);rn radioGroup.setOrientation(RadioGroup.VERTICAL);rn radioGroup.setLayoutParams(rParams);rn radioGroup.setOnCheckedChangeListener(this);rn rn RadioButton radioButton = new RadioButton(this);rn radioButton.setText("Yellow");rn radioButton.setId(1001);rn rParams = new RadioGroup.LayoutParams(WC, WC);rn radioGroup.addView(radioButton, rParams);rn rn RadioButton radioButton1 = new RadioButton(this);rn radioButton1.setText("Blue");rn radioButton1.setId(1002);rn rParams = new RadioGroup.LayoutParams(WC, WC);rn radioGroup.addView(radioButton1, rParams);rn rn setContentView(radioGroup);rn rn rn public void onCheckedChanged(RadioGroup arg0, int arg1)rn rn String cc;rn if (arg0.getCheckedRadioButtonId() == 1001)rn rn cc = "Y";rn rn else rn rn cc = "B";rn rn Bundle bundle = new Bundle();rn bundle.putString("DataKey", cc);rn Intent intent = new Intent();rn intent.putExtras(bundle);rn setResult(RESULT_OK, intent);rn finish();rn rn[/color]rnrnrnpackage com.misoo.ex01;rnrnimport android.content.Context;rnimport android.graphics.Canvas;rnimport android.graphics.Color;rnimport android.graphics.Paint;rnimport android.view.View;rnrnpublic class DrawView extends Viewrnrn private Paint paint;rn private Context context;rn public DrawView (Context context)rn rn super(context); rn this.context = context;rn paint = new Paint();rn rn rn @Override rn protected void onDraw(Canvas canvas)rn rn Ex01 ex01 = (Ex01) context;rn paint.setColor(ex01.getColor());rn canvas.drawRect(10, 10, 100, 100, paint);rn paint.setColor(Color.GREEN);rn paint.setStrokeWidth(4);rn paint.setStrokeCap(Paint.Cap.ROUND);rn canvas.drawLine(10, 55, 100, 55, paint);rn canvas.drawLine(55, 10, 55, 100, paint);rn paint.setColor(Color.RED);rn canvas.drawRect(50, 50 ,60, 60, paint);rn rnrnrn按照一本教材写的代码。运行后只出现如下界面,点changecolor出错。 Console没有报具体错误rnrn[img=http://hi.csdn.net/attachment/201004/27/2485952_1272350353f4ww.jpg][/img]
VC++编写的OpenGL动画
VC++编写的OpenGL动画,各种VC环境下可运行,前提是要有OpenGL的库文件
OpenGL 动画的性能问题
我是初学OpenGL, 发现用Timer定时器触发动画,性能太差,时间间隔设置的越短,CPU占用率越高,正常都在50%向上rnrn有没有更节能CPU的方法?rnrn
OpengL动画问题
本程序基于mfc对话框的在opengl中画几何字体,用到了glut包的函数,但是在onTimer中旋转字体时发现没有看到旋转的字体(动画只是一闪而过)。请大家帮忙修改下。谢谢。rn[color=#FF0000]OnCreate函数:[/color]rn添加的代码:rn// TODO: Add your specialized creation code herernUINT_PTR TimeToDraw = this->SetTimer(1,500,NULL);rnrn[color=#FF0000]OnTimer函数:[/color]rnvoid CDrawTextOGLDlg::OnTimer(UINT nIDEvent) rnrn // TODO: Add your message handler code here and/or call defaultrn if (nIDEvent==1)rn rn if (Rotate_Angle<360.0)rn rn Rotate_Angle+=0.05;rn rn elsern Rotate_Angle = 0.0;rnrn Invalidate(FALSE);rn rn CDialog::OnTimer(nIDEvent);rnrnrn[color=#FF0000]OnPaint函数:[/color]rn添加了:this->output(-0.7,0.0,0.0,"Hello World!");rnrn[color=#FF0000]Output函数:[/color]rnvoid CDrawTextOGLDlg::output(GLfloat x, GLfloat y, GLfloat z, char *text)rnrn char *p;rn rn //make glClearColor function called before glClearrn //glClearColor(0.0,1.0,0.0,0.0);rn glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);rnrn glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);rn glEnable(GL_BLEND);rn glEnable(GL_LINE_SMOOTH);rn glLineWidth(7.0);rnrn glRotatef(Rotate_Angle,0.0,0.0,1.0);rn glTranslatef(x, y, z);rn glScalef(.002,.002,.002);rn rn glPushMatrix();rn glColor4f(1.0f,0.0f,0.0f,1.0f);rnrn for (p = text; *p; p++)rn glutStrokeCharacter(GLUT_STROKE_ROMAN, *p);rn glPopMatrix();rn rn SwapBuffers(m_hdc);rn
为何我的菜单会跑位,急!!!
当我在不同分辨率下,下拉菜单在主菜单下的位置不同,苦闷,急!!!rnrn rn rnrnrn 眼 rn 部rn rn 唇 rn 部rn rn 脸 rn 部rn rn 甲 rn 部 rn rn rn 化妆工具rn rnrn rn rn rn rn rn rn rn rn rn rn rn
opengl自动画壶
本代码是opengl自动画茶壶,供编程爱好者使用
OPENGL画矩形动画
OPENGL画矩形动画,矩形不停地移动碰到边界自动反弹向相反方向移动
opengl 实现的完美动画
opengl 实现的完美动画!绝对绚丽!!高清!!有这方面需求的可以看下哦!
计算机图形学OPENGL 动画代码
计算机图形学课程设计 OPENGL绘制的,MFC为框架的动画,收集硬币
OpenGL源码 指环王动画
模拟指环王中动画场景,效果很好 vc++下的OpenGL编程
OpenGL 内插动画Demo
OpenGL 内插动画Demo OpenGL 内插动画Demo OpenGL 内插动画Demo OpenGL 内插动画Demo OpenGL 内插动画Demo OpenGL 内插动画Demo OpenGL 内插动画Demo OpenGL 内插动画Demo
世界排名第一的OPENGL动画
世界排名第一的OPENGL动画 世界排名第一的OPENGL动画
opengl制作的毛笔动画
通过opengl的制作,展现了所写毛笔字被拉伸的效果,初学者可以学一学
相关热词 c# stream 复制 android c# c#监测窗口句柄 c# md5 引用 c# 判断tabtip 自己写个浏览器程序c# c# 字符串变成整数数组 c#语言编程写出一个方法 c# 转盘抽奖 c#选中treeview