https://www.youtube.com/watch?v=XVlG7opaPHs
https://www.facebook.com/photo/?fbid=46 ... 9293011580
..
i tried hello world of irrlicht,the model shows but the texture is all white,How can i fix it?
..
source code is
#include <iostream>
#include "./../../../jin irrichit/irrlicht-1.8.5/include/irrlicht.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
#ifdef _IRR_WINDOWS_
#pragma comment(lib, "./../../../jin irrichit/irrlicht-1.8.5/lib/Win64-visualStudio/Irrlicht.lib")
#pragma comment(linker, "/subsystem:windows /ENTRY:mainCRTStartup")
#endif
int main()
{
std::cout << "Hello World!\n";
IrrlichtDevice* device =
createDevice(video::EDT_SOFTWARE, dimension2d<u32>(640, 480), 16,
false, false, false, 0);
if (!device)
return 1;
device->setWindowCaption(L"Hello World! - Irrlicht Engine Demo");
IVideoDriver* driver = device->getVideoDriver();
ISceneManager* smgr = device->getSceneManager();
IGUIEnvironment* guienv = device->getGUIEnvironment();
guienv->addStaticText(L"장진형.Hello World! This is the Irrlicht Software renderer!",
rect<s32>(10, 10, 260, 22), true);
IAnimatedMesh* mesh = smgr->getMesh("./../../../jin irrichit/irrlicht-1.8.5/media/sydney.md2");
if (!mesh)
{
device->drop();
return 1;
}
IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode(mesh);
smgr->addCameraSceneNode(0, vector3df(0, 30, -40), vector3df(0, 5, 0));
while (device->run())
{
driver->beginScene(true, true, SColor(255, 100, 101, 140));
smgr->drawAll();
guienv->drawAll();
driver->endScene();
}
device->drop();
return 0;
}
texture is white..hello world
Re: texture is white..hello world
Is there any information in the console window. Something like texture not found?
You might try using createDevice with video::EDT_OPENGL in case it works better.
Maybe start by running the original examples in the examples folder. Those come with project files and correct paths.
And best to start with svn trunk version of Irrlicht (https://sourceforge.net/p/irrlicht/code/HEAD/tree), the 1.8 version is a bit behind by now.
And default font won't have asian character, sorry. You need to create another font for that.
You might try using createDevice with video::EDT_OPENGL in case it works better.
Maybe start by running the original examples in the examples folder. Those come with project files and correct paths.
And best to start with svn trunk version of Irrlicht (https://sourceforge.net/p/irrlicht/code/HEAD/tree), the 1.8 version is a bit behind by now.
And default font won't have asian character, sorry. You need to create another font for that.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Re: texture is white..hello world
https://www.youtube.com/watch?v=-jb7sphi-l8
Thank you..I've changed to createDevice to OPENGL,and model became black cover..
is light missing?how can I fix it?
Thank you..I've changed to createDevice to OPENGL,and model became black cover..
is light missing?how can I fix it?
Re: texture is white..hello world
What about the console window? Are there any messages? It's the info we need to help... (my guess is still it simply doesn't find the textures).
If you made a new project for this and you made that project without console then please start it from a console so you see the output. You'll need a way to see that anyway if you develop. Or use Irrlicht examples - they start with console window.
And sorry, but I removed your other thread, please don't split this into 2, it's still the same problem.
If you made a new project for this and you made that project without console then please start it from a console so you see the output. You'll need a way to see that anyway if you develop. Or use Irrlicht examples - they start with console window.
And sorry, but I removed your other thread, please don't split this into 2, it's still the same problem.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Re: texture is white..hello world
OK, I see it - .md2 doesn't load textures. You have to set the texture yourself as the first Irrlicht example does. I didn't see you removed that part. So... you removed the texture loading from the example and then wonder why your texture is gone...
Add this back:
Add this back:
Code: Select all
if (node)
{
node->setMaterialFlag(EMF_LIGHTING, false);
node->setMaterialTexture( 0, driver->getTexture("../../media/sydney.bmp") ); // use your real path here
}
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Re: texture is white..hello world
I am using latest irrlicht engine..and in the code,there is no mode,
only IAnimatedMesh* mesh = smgr->getMesh("./../.. exist..
I can't find node->setMaterialTexture( 0, driver->getTexture("../../media/sydney.bmp") ); // use your real path here
}
only IAnimatedMesh* mesh = smgr->getMesh("./../.. exist..
I can't find node->setMaterialTexture( 0, driver->getTexture("../../media/sydney.bmp") ); // use your real path here
}
Re: texture is white..hello world
In the lastest Irrlicht engine (svn trunk), this are the lines 217-222 in example 01 Hello World.
In Irrlicht 1.8 it's lines 185-189.
In the website tutorial (https://irrlicht.sourceforge.io/docu/example001.html) search for "syndey.bmp" and you'll also see it.
If you got your example from some other place... uh... no idea. Maybe you accidentally removed the lines, happens. As long as it works now ;-)
In Irrlicht 1.8 it's lines 185-189.
In the website tutorial (https://irrlicht.sourceforge.io/docu/example001.html) search for "syndey.bmp" and you'll also see it.
If you got your example from some other place... uh... no idea. Maybe you accidentally removed the lines, happens. As long as it works now ;-)
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm