|
- for(unsigned int i = 0; i < 6; i++)
- {
- image_data[i] = new unsigned char[512*512*3];
- cube_surface[i] = new osg::Image;
- cube_surface[i]->allocateImage(512,512,1,GL_BGR,GL_UNSIGNED_BYTE);
- cube_surface[i]->setOrigin(osg::Image::TOP_LEFT);
- cube_surface[i]->setImage(512,512,
- 1,GL_RGB,GL_BGR,GL_UNSIGNED_BYTE,(BYTE*)image_data[i],
- osg::Image::AllocationMode::USE_NEW_DELETE);
- }
复制代码 如上设置Origin属性为:TOP_LEFT。
官方解释如下:
TOP_LEFT is used for imagery that follows standard Imagery convention, such as movies, and hasn't been flipped yet. For such images one much flip the t axis of tex coords.
不过,我发现设置了TOP_LEFT和不设置(默认的BOTTOM_LEFT)在贴图时没有区别啊,也没有上下翻转。 |
|