- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
一个简单的三维程序(A simple three-dimensional program)
一个简单的三维程序(A simple three-dimensional program)
/ * this is a simple three-dimensional engine program, imitate the three celestial movement, a planet rotates on its axis, two satellites were around the planet
Warp and woof make revolution. (compiled successfully under turboc3.0).
#includestdio.h
#includedos.h
#includeconio.h
#includegraphics.h
#includestdlib.h
#includealloc.h
#includetime.h
#includebios.h
#includestring.h
#includemath.h
#define ESC 27
#define F 80 / / the number of said normally from the computer operator distance (80 cm)
#define HIGHT / / 480 screen longitudinal resolution
#define WIDE / / 640 screen resolution
#define PAI 3.1415926 / PI
#define TIME / / 0.05 rotation intervals (every 0.2 seconds to rotate 5 degrees)
Typedef struct
{float x;
Float y;
}_2D; / / 2D coordinates
Typedef struct
{float x;
Float y;
Float z;
}_3D; / / 3D coordinates
Typedef struct
{int anglex;
Int angley;
Int anglez;
}Axle; / / shaft (angle X, y vector, Z vector and X Y respectively, and the Z axis angle)
Typedef struct
{// latitude circle from the equator and the northern and southern hemispheres of the four circles of latitude 9 circles of latitude, longitude divided into 10 circles
So use / / g[9][10] two-dimensional array to record the latitude and longitude of the intersection
_3D *g[9][10];
/ / temp[9][10] is used to record the coordinates of each point from the 3D to 2D g[9][10] transform at
_2D *temp[9][10];
_3D *center; / / rotation center coordinates, namely the center coordinates
_3D *round_center; / / revolution center coordinates
Float R; / / sphere radius
}Globe; / / sphere
Float Observe_Mat[4][4], World_Mat[4][4]; / / view coordinate and world coordinate matrix matrix
Float Sin[360], Cos[360]; / / two array to store the trigonometric function values, reducing the number of floating point operations, to improve the efficiency
Size_t Size2D, Size3D, Sizeaxle, Sizeglobe; / / the size of the structure
_3D *Observe; / / the position coordinates of the observer
Glob
您可能关注的文档
- glsl内置变量(Glsl built-in variables).doc
- godaddy 域名被盗 帐号被盗 邮箱被改 找回全过程(Godaddy domain name stolen, account stolen, mailbox was changed to retrieve the whole process).doc
- google与反管理托拉斯引擎故障(Google and anti management trust engine failure).doc
- gdwegfd(gdwegfd).doc
- gs出品--高中地理学习方法(GS produced - high school geography learning methods).doc
- fanuc_系统部分参数功能目录(Fanuc_ system part parameter function catalog).doc
- g指令m指令(G instruction, m instruction).doc
- g牌啤酒新品开发与品牌整合之道(G brand new beer development and brand integration).doc
- hibernate_list(one_to_many)有下标(hibernate_list(one_to_many)有下标).doc
- hdl 2000(高密度脂蛋白 2000).doc
原创力文档


文档评论(0)