Hi @all.
I'm new to irrLicht, so I have some questions on it.
When loading an ordinary box form a mesh file and assigning a texture, how has
the texture look a like. I mean has the texture to be an U/V Map with the unwrapped cube,
or is a plain picture enough.
How do I know in which size to scale the texture, and what if i want the texture to only on one side?
Tnx
Textures
-
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
If the box has a different texture on each side you can either use an unwrapped cube or 6 materials with different textures (and different materials assigned to each side). Otherwise it's ok to use just one plain image. The texture coords are usually between 0 and 1. If you choose different range or if you scale the texture coords you will get a repeating texture (or a partial texture when scaling smaller). That depends on what you're going to do.
Applying it only to one side is either done with different materials or by blending a transparent texture with the vertex color (not sure if such a material exists, though).
Applying it only to one side is either done with different materials or by blending a transparent texture with the vertex color (not sure if such a material exists, though).
Ok, thanks for the fast reply.
So I don't understand why my texture is not drwan correctly, or I can't see it.
I see a brown cube instead of a black one, so the texture is apllied.
But what I expected to see are the stones from the picture.
This is the code:
So nothing special I'd say. Do I have to rescale the texture, and if yes, how do I do it?
Tnx
So I don't understand why my texture is not drwan correctly, or I can't see it.
I see a brown cube instead of a black one, so the texture is apllied.
But what I expected to see are the stones from the picture.
This is the code:
Code: Select all
ISceneNode *node = scenemgr->addAnimatedMeshSceneNode(scenemgr->getMesh("../tiles/box.3ds"));
node->setPosition(core::vector3df(0,0,0));
node->setMaterialTexture(0, driver->getTexture("../textures/mosaic_floor_tile_scaled2.jpg"));
node->setMaterialFlag(EMF_LIGHTING, false);
ICameraSceneNode* cam = scenemgr->addCameraSceneNodeFPS(0, 100.0f, 100.0f);
cam->setPosition(core::vector3df(5,5,0));
cam->setTarget(core::vector3df(0,0,0));
while(device->run() && driver){
if (device->isWindowActive()){
driver->beginScene(true, true, SColor(255,100,101,140));
scenemgr->drawAll();
driver->endScene();
}
}
Tnx