-
Notifications
You must be signed in to change notification settings - Fork 124
Open
Description
SoTextureCubeMap seems to map the textures incorrectly. I tried setting the filenames field with 6 images and also the image* fields individually but in both cases the textures look distorted. Texture mapping a SoCube with a single SoTexture2 seems to work fine.
Here is some code for reference:
auto get_cubemap_filenames() {
const static char *filenames[] = {
"right.jpg", "left.jpg",
"top.jpg", "bottom.jpg",
"front.jpg", "back.jpg"
};
return filenames;
}
void add_cube(SoSeparator *root) {
auto cube_separator = new SoSeparator;
auto ts = new SoTranslation;
ts->translation = {2, 0, 0};
cube_separator->addChild(ts);
SoInput::addDirectoryFirst("../assets/skybox");
// SoTexture2 *texture = new SoTexture2;
// texture->filename = "back.jpg";
// cube_separator->addChild(texture);
auto cube_map = new SoTextureCubeMap;
cube_map->filenames.setValues(0, 6, get_cubemap_filenames());
cube_separator->addChild(cube_map);
auto cube = new SoCube;
cube->width = 1.0f;
cube->height = 1.0f;
cube->depth = 1.0f;
cube_separator->addChild(cube);
root->addChild(cube_separator);
}I am on debian linux and using the latest version of coin from github. I first created a discussion about this here as I wasn't sure if this is a bug or wrong usage of the api from my side.
Metadata
Metadata
Assignees
Labels
No labels