- 积分
- 96
- 帖子
- 68
- 主题
- 15
- 精华
- 0
- 最后登录
- 2012-2-9
- 在线时间
- 34 小时
- 私信
|
发表时间 : 2010-4-20 14:58:21
|
浏览 : 974 评论 : 1
本帖最后由 jgy86324 于 2010-4-20 02:59 PM 编辑
部分代码贴出如下:
// Initialize Searchpath for images
tmpSPath = vuImageFactory::getDefaultSearchPath();
tmpSPath->set("$(MPI_INSTALL_RESOURCE_DEFAULT)\\resources\\data\\textures");
const char* searchpath = vuImageFactory::getDefaultSearchPath()->get();
// Initialize Searchpath for textures
tmpSPath = vrTextureFactory::getDefaultSearchPath();
tmpSPath->set( searchpath );
// Read the uncompressed texture.
vrTextureFactory* tFact = new vrTextureFactory();
m_texUncompressed = tFact->read("mpi_logo.rgba");
if (!m_texUncompressed)
{
vuNotify::print(vuNotify::LEVEL_FATAL,NULL,
"Could not find file %s\n", "mpi_logo.rgba");
m_box->unref();
tFact->unref();
exit(1);
}
m_texUncompressed->ref();
// Read the compressed dds texture.
m_texCompressed = tFact->read("mpi_logo.dds");
第一次加色处:tmpSPath->set("$(MPI_INSTALL_RESOURCE_DEFAULT)\\resources\\data\\textures");
这个是关于纹理的找寻途径,是我放文件mpi_logo.rgba和mpi_logo.dds的地方吗?
第二和第三次加色处:m_texUncompressed = tFact->read("mpi_logo.rgba");m_texCompressed = tFact->read("mpi_logo.dds");后缀为rgba和dds这两个文件分别是什么?这两个文件用什么做出来的?我加纹理支持哪些格式,比如说jpg,bup这些支持吗?
小弟现在在做一个天空盒练手,关于天空盒的纹理我怎么去得到然后直接贴到盒子上去,如果有这个纹理的话也希望传出来分享下,谢谢。。。。。还有就是天空盒贴纹理需要贴在盒子的内部,这个需要怎么去实现? |
|