OpenGL 基于OpenGL的三维机器人仿真

OpenGL 基于OpenGL的三维机器人仿真
摘要由CSDN通过智能技术生成

分享一下我老师大神的人工智能教程!零基础,通俗易懂!http://blog.csdn.net/jiangjunshow

也欢迎大家转载本篇文章。分享知识,造福人民,实现我们中华民族伟大复兴!

               

基于OpenGL的三维机器人仿真

#include<windows.h>#include<gl/glut.h>#pragma comment(lib, "glut32.lib")#include <iostream>using namespace std;GLfloat no_mat[]   = { 0.0, 0.0, 0.0, 1.0 };GLfloat mat_ambient[]  = { 0.8, 0.8, 0.8, 1.0 };GLfloat mat_ambient_color[] = { 0.8, 0.8, 0.2, 1.0 };GLfloat mat_diffuse[]  = { 0.5, 0.8, 0.0, 1.0 };GLfloat mat_specular[]  = { 1.0, 0.0, 0.5, 1.0 };GLfloat no_shininess[]  = { 0.5 };GLfloat low_shininess[]  = { 5.0 };GLfloat high_shininess[] = { 100.0 };GLfloat mat_emission[]  = {
   0.3, 0.2, 0.2, 0.0};static int angle = 0, neck = 0, lshoulder = 0, lelbow = 0, rshoulder = 0, relbow = 0,lhips = 0, rhips = 0, lfoot = 0, rfoot = 0, flagneck = 0, flaglshoulder = 0,flaglelbow = 0, flagrshoulder = 0, flagrelbow = 0, flaglhips = 0,flagrhips = 0, flaglfoot = 0, flagrfoot = 0;void init(void){ GLfloat ambient[] = { 0.0, 0.0, 0.0, 1.0 }; GLfloat diffuse[] = { 1.0, 1.0, 1.0, 1.0 }; GLfloat position[] = { 0.0, 5.0, 10.0, 0.0 }; GLfloat lmodel_ambient[] = { 0.4, 0.4, 0.4, 1.0 }; GLfloat local_view[]  = { 0.0 }; glClearColor(0,0,0,0); glLightfv(GL_LIGHT0, GL_AMBIENT, ambient); glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse); glLightfv(GL_LIGHT0, GL_POSITION, position); glLightModelfv(GL_LIGHT_MODEL_AMBIENT, lmodel_ambient); glLightModelfv(GL_LIGHT_MODEL_LOCAL_VIEWER, local_view); glShadeModel(GL_SMOOTH); glEnable(GL_DEPTH_TEST); glEnable(GL_LIGHTING)
  • 2
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值