hi
i need help im creating a game and im in in irrlicht functions so i have a camera with a projection orthogonal and i made a skybox
its working without a problem./ now my problem is beacuse the camera is orthogonal which means i cant move in Z which is normal the texture or image on the skybox is too flu bcz its too lcose so what im trying to say is that i nedd help in showing the texture of the sky.
PS: my camera is fixed so it moves when the person is movining the end of the screen
if any help here is my both code
in the main:
IrrlichtDevice* device = createDevice(video::EDT_OPENGL,
core::dimension2d<s32>(800, 600), 16, false, false, false, 0);
Game::getGame()->setDevice(device);
video::IVideoDriver* driver = device->getVideoDriver();
scene::ISceneManager* vue = device->getSceneManager();
vue->addAnimatedMeshSceneNode(vue->getMesh("ninja.b3d"));
scene::ISceneNode* ni = vue->addSkyBoxSceneNode(driver->getTexture("2.jpg"),
driver->getTexture("2.jpg"),driver->getTexture("2.jpg"),
driver->getTexture("2.jpg"),driver->getTexture("2.jpg"),
driver->getTexture("2.jpg"));
in the camera file:
matrix4 projMat;
Camera = smgr->addCameraSceneNode(0,vector3df(-39,17,25),
vector3df(0,17,25),id );
projMat.buildProjectionMatrixOrthoLH(65*TestNode,50*TestNode,1,100000);//80*TestNode,60*TestNode,10,1000);
Camera->setProjectionMatrix(projMat);
addskyboxscencenode and camera projection orhtogonal
-
- Competition winner
- Posts: 1123
- Joined: Sun Jun 10, 2007 11:14 pm
So what you're trying to do is scale the texture in the skybox?
Ok, here is the code assuming your skybox's name is skybox:
The vector2df(2,2) at the end of buildTextureTransform is how many times you want the texture to repeat.
Ok, here is the code assuming your skybox's name is skybox:
Code: Select all
for (int x = 0; x < skybox->getMaterialCount(); x++) {
core::matrix4 m = skybox->getMaterial(x).getTextureMatrix(0);
m.buildTextureTransform(0,core::vector2df(0,0),core::vector2df(0,0),core::vector2df(2,2));
skybox->getMaterial(x).setTextureMatrix(0,m);
skybox->getMaterial(x).TextureLayer[0].TextureWrap = video::ETC_REPEAT;
}