Lighting a 3DS Model.
Lighting a 3DS Model.
Hello All,
Noob Irrlicht user here.
I am using Irrlicht for a graduation project, having to do with sound so I don't know much about graphics programming.
I built a very simple model in SketchUp and exported it as a 3DS file, and got that to load into Irrlicht fairly easily. The only downside is that the map is very dark. Since SketchUp doesn't offer a way to add lights, is there a way I add some lights to my scene in Irrlicht fairly easily?
I do not need anything fancy, just I need the general ambiance light raised.
Thanks in advance.
Peace
Staque
Noob Irrlicht user here.
I am using Irrlicht for a graduation project, having to do with sound so I don't know much about graphics programming.
I built a very simple model in SketchUp and exported it as a 3DS file, and got that to load into Irrlicht fairly easily. The only downside is that the map is very dark. Since SketchUp doesn't offer a way to add lights, is there a way I add some lights to my scene in Irrlicht fairly easily?
I do not need anything fancy, just I need the general ambiance light raised.
Thanks in advance.
Peace
Staque
Check out irrEdit, it'll probably help some.
http://www.ambiera.com/irredit/index.html
http://www.ambiera.com/irredit/index.html
If you don't have anything nice to say, don't say anything at all.
heres the code your looking for.
Code: Select all
ISceneNode * light = smgr->addLightSceneNode(0,vector3df(40,30,0),SColorf(1.f, 1.f, 1.f,0.f), 200.f);No Luck.
I tried the code... but I didn't notice much difference...franklyn wrote:heres the code your looking for.Code: Select all
ISceneNode * light = smgr->addLightSceneNode(0,vector3df(40,30,0),SColorf(1.f, 1.f, 1.f,0.f), 200.f);
Here is the code.
Okie Dokie... Here is my code.
As you can tell this... is pretty much just a variation of the "Quake Map" Tutorial and the "Collision" tutorial. Which I part of the reason why I am stumped with the lighting problem.
I should note... I only need to raise the lighting a bit for debugging purposes, and that later on I will need to make the screen gradually go completely dark [IE You see absolutely nothing.]
Sorry if this is a completely Noob problem... but thanks for the help in advance.
Also... To note an earlier suggestion... I did original try to use IrrEdit and Irr Files. Which I did achieve correct lighting with. But I need to use createOctTreeTriangleSelector() to create collision. From reading the forums as I understand it, I couldn't use Irr files because there isn't a way to pull a mesh from a Irr Scene that is needed for the createOctTreeTriangleSelector() function. [Plus I was getting tired of correcting the paths to the textures, but that is another story]. At least nothing simple. And since I am only using one Mesh, I figured it would be easier to load the mesh in directly.
Anyway here is the code.
Peace and thanks again.
As you can tell this... is pretty much just a variation of the "Quake Map" Tutorial and the "Collision" tutorial. Which I part of the reason why I am stumped with the lighting problem.
I should note... I only need to raise the lighting a bit for debugging purposes, and that later on I will need to make the screen gradually go completely dark [IE You see absolutely nothing.]
Sorry if this is a completely Noob problem... but thanks for the help in advance.
Also... To note an earlier suggestion... I did original try to use IrrEdit and Irr Files. Which I did achieve correct lighting with. But I need to use createOctTreeTriangleSelector() to create collision. From reading the forums as I understand it, I couldn't use Irr files because there isn't a way to pull a mesh from a Irr Scene that is needed for the createOctTreeTriangleSelector() function. [Plus I was getting tired of correcting the paths to the textures, but that is another story]. At least nothing simple. And since I am only using one Mesh, I figured it would be easier to load the mesh in directly.
Anyway here is the code.
Peace and thanks again.
Code: Select all
IrrlichtDevice *device = createDevice(EDT_OPENGL, dimension2d<s32>(640, 480), 16, false, false, false, 0 );
if (device == 0)
return 1;
//We Say Hello.
device->setWindowCaption(L"Hello World! - Irrlicht Engine Demo");
//Now we store a pointer to the video driver, the SceneManager, and the graphical user interface environment
//so that we do not always have to write device->getVideoDriver(), device->getSceneManager(), and device->getGUIEnvironment().
IVideoDriver* driver = device->getVideoDriver();
ISceneManager* smgr = device->getSceneManager();
//Load each Mesh Individually
IAnimatedMesh* mesh = smgr->getMesh("TestPlane.3ds");
ISceneNode* node = 0;
if (mesh) node = smgr->addOctTreeSceneNode( mesh->getMesh(0) );
ITriangleSelector* selector = 0;
if (node)
{
node->setMaterialFlag( EMF_LIGHTING, false );
selector = smgr->createOctTreeTriangleSelector(mesh->getMesh(0), node, 128);
node->setTriangleSelector(selector);
selector->drop();
}
//Suggestion 1
//This one doesn't seem to effect the lighting, and I tried setting the EMF_LIGHTING flage to true & false
//ISceneNode * light = smgr->addLightSceneNode( 0, vector3df( 30, 40,0), SColorf(1.f, 1.f, 1.f,0.f), 600.f);
//Suggestion2
//SceneManager->setAmbientLight(LightColor)
//The Scene:: Class doesn't not seem to havee a 'setAmbientLight(LightColor)' method.
//I could only find something in the Video:: class which is below and did not work.
//driver->setAmbientLight( SColorf(1.f, 1.f, 1.f,1.f) );
//Then we add a FPS camera to the scene graph.
ICameraSceneNode *camera = smgr->addCameraSceneNodeFPS(0, 100.0f, 300.0f, -1, 0, 0, true);
ISceneNodeAnimator* anim = smgr->createCollisionResponseAnimator( selector, camera, vector3df(30,50,30), vector3df(0,-3,0), vector3df(0,50,0) );
camera->addAnimator(anim);
anim->drop();