Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
render_data.h
Package: chap03.rar [view]
Upload User: gzqinmao
Upload Date: 2022-07-13
Package Size: 472k
Code Size: 1k
Category:
OpenGL program
Development Platform:
Visual C++
- #include "Vector4.h"
- #include "Matrix4x4.h"
- struct Vertex_VC
- {
- float m_Position[3];
- // R,G,B,A in OpenGL
- // B,G,R,A in Direct3D 9
- // Direct3D 10可是是两种其中之1, 看设置而定.
- unsigned char m_RGBA[4];
- };
- // 球的数据
- extern Vertex_VC *g_pSunVertices;
- extern Vertex_VC *g_pEarthVertices;
- extern Vertex_VC *g_pMoonVertices;
- extern unsigned short *g_pSphereIndices;
- extern int g_iNumSphereVertices;
- extern int g_iNumSphereTriangles;
- extern int g_iNumSphereIndices;
- // 镜头位置
- extern Vector4 g_eye;
- // 镜头对准的点
- extern Vector4 g_lookat;
- // 镜头正上方的方向
- extern Vector4 g_up;
- // 镜头转换矩阵
- extern Matrix4x4 g_view_matrix;
- //
- extern Matrix4x4 g_sun_matrix, g_earth_matrix, g_moon_matrix;
- // 生成球模型的程序
- bool CreateSphere(float radius, Vertex_VC **ppVertices, unsigned short **ppIndices, float *color=NULL, int stacks = 20, int pieces = 20);