资源描述:
《opengl3d迷宫c实现源代码》由会员上传分享,免费在线阅读,更多相关内容在应用文档-天天文库。
1、实用文案#include"stdafx.h"#include#include#include#include#includeusingnamespacestd;voiddrawwalls(void);voiddrawtop(void);voiddrawball(void);#defineIDM_APPLICATION_EXIT(101)#defineIDM_APPLICATION_TEXTURE(102)#defineIDM_APPLICATION_BANK(103)#defineMAZE_HEI
2、GHT(16)#defineMAZE_WIDTH(16)#defineSTARTING_POINT_X(13.5f);#defineSTARTING_POINT_Y(1.5f);#defineSTARTING_HEADING(90.0f);floatplayer_x=STARTING_POINT_X;floatplayer_y=STARTING_POINT_Y;floatplayer_h=STARTING_HEADING;//player'sheadingfloatplayer_s=0.0f;//forwardspeedoftheplayerfloatplayer_m=1.0f;//spee
3、dmultiplieroftheplayerfloatplayer_t=0.0f;//player'sturning(changeinheading)floatplayer_b=0.0f;//viewpointbank(roll)staticfloattexcoordX=0.0f;intwalllist=0;intmazelist=0;intballlist=0;intstatus=1;boolsearchroute=false;boolkeystate[4]={false,false,false,false};charmazedata[MAZE_HEIGHT][MAZE_WIDTH]={{
4、'H','H','H','H','H','H','H','H','H','H','H','H','H','H','H','H'},{'H','','','','','','','','H','','','','','','','H'},{'H','','H','','H','H','H','','H','','H','','','','','H'},{'H','','H','H','','','H','','H','H','','H','','H','','H'},{'H','','','','','','H','','','','','','','H','','H'},{'H','','H
5、','H','H','H','H','H','H','H','','H','H','H','','H'},标准文档实用文案{'H','','','','','','','','','','','','H','','','H'},{'H','','H','H','H','H','H','','H','H','H','','H','H','H','H'},{'H','','H','','','','H','','','','H','','','','','H'},{'H','','','','H','H','H','H','H','H','H','','','','','H'},{'H','',
6、'H','','','','H','','','','H','','','H','','H'},{'H','','H','H','H','H','H','','H','H','H','H','','H','','H'},{'H','','','','','','H','','','','','','','H','','H'},{'H','','','H','H','','H','H','H','H','','H','H','H','','H'},{'H','','','','H','','H','','','','','H','','','','H'},{'H','H','H','H','H
7、','H','H','H','H','H','H','H','H','','H','H'},};voidmyinit(){glClearColor(0.5f,0.5f,0.5f,0.0f);glColor3f(1.0,1.0,1.0);glEnable(GL_DEPTH_TEST);glEnable(GL_TEXTURE_2D);walllist=glGenLists(2);mazelist=walllist