How I can start in the center of my mesh?
I think you mean node, not mesh...
you can try it with:but I doubt that is what you want...
it's not that easy though, because a mesh usually is more complex...
you can try it with:
Code: Select all
vector3df cntr = node->getBoundingBox().getCenter();
it's not that easy though, because a mesh usually is more complex...
while(!asleep) sheep++;
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
I don't know, tell me what you expect and what you get...Gideon wrote:What is it?
while(!asleep) sheep++;
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
Code:
Code: Select all
#include <irrlicht.h>
#include <iostream>
using namespace irr;
#pragma comment(lib, "Irrlicht.lib")
int main()
{
IrrlichtDevice *device =
createDevice(video::EDT_OPENGL, core::dimension2d<s32>(640, 480));
if (device == 0)
return 1;
video::IVideoDriver* driver = device->getVideoDriver();
scene::ISceneManager* smgr = device->getSceneManager();
device->getFileSystem()->addZipFileArchive("../../media/mapppeZ!.zip");
scene::IAnimatedMesh* mesh = smgr->getMesh("ee.b3d");
scene::ISceneNode* node = 0;
if (mesh)
node = smgr->addOctTreeSceneNode(mesh->getMesh(0), 0, -11, 12);
if (node)
node->setPosition(core::vector3df(0,-1,0));
smgr->addSkyBoxSceneNode(
driver->getTexture("../../media/irrlicht2_up.jpg"),
driver->getTexture("../../media/irrlicht2_dn.jpg"),
driver->getTexture("../../media/irrlicht2_lf.jpg"),
driver->getTexture("../../media/irrlicht2_rt.jpg"),
driver->getTexture("../../media/irrlicht2_ft.jpg"),
driver->getTexture("../../media/irrlicht2_bk.jpg"));
scene::ICameraSceneNode* cam = smgr->addCameraSceneNodeFPS(0, 100.0f, 100.0f);
cam->setPosition(core::vector3df(0,0,0));
cam->setTarget(core::vector3df(0,0,0));
smgr->addCameraSceneNodeFPS();
device->getCursorControl()->setVisible(false);
int lastFPS = -1;
while(device->run())
{
if (device->isWindowActive())
{
driver->beginScene(true, true, video::SColor(255,200,200,200));
smgr->drawAll();
driver->endScene();
int fps = driver->getFPS();
if (lastFPS != fps)
{
core::stringw str = L"gently caress!!!!!!!!!";
str += driver->getName();
str += " | FPS:";
str += fps;
device->setWindowCaption(str.c_str());
lastFPS = fps;
}
}
else
device->yield();
}
device->drop();
return 0;
}
is that even vaguely like it should look?
it's probably nothing to do with normals as normals are just used for lighting and this clearly isn't a lighting issue.
more likely the triangles are wound the wrong way round so they're facing the opposite direction to where they should be facing. so you've probably got backface culling turned on so you don't see the backs of the triangles which in this case you would want to, you can change this parameter in irredit under the materials section. but of course for efficiency's sake you'd want backface culling on and for the triangles to be wound correctly, which would have to be sorted out in your modelling program.
it's probably nothing to do with normals as normals are just used for lighting and this clearly isn't a lighting issue.
more likely the triangles are wound the wrong way round so they're facing the opposite direction to where they should be facing. so you've probably got backface culling turned on so you don't see the backs of the triangles which in this case you would want to, you can change this parameter in irredit under the materials section. but of course for efficiency's sake you'd want backface culling on and for the triangles to be wound correctly, which would have to be sorted out in your modelling program.
Sorry i thought you were using irredit but you're not (or not in the screenshots anyway), it's not necessary to use irredit for this but you can do. it's in the materials tab of the node, bottom left when you have the correct node selected, scroll down a bit and there's a tick box to turn back face culling on or off.
In irrlicht though you can set it like this:
node->setMaterialFlag(video::EMF_BACKFACE_CULL, false);
I think that's the right enum, you might have to check the API if it doesn't compile!
In irrlicht though you can set it like this:
node->setMaterialFlag(video::EMF_BACKFACE_CULL, false);
I think that's the right enum, you might have to check the API if it doesn't compile!