I created a simple red cube without texture in 3ds max, and exported to 3ds.
When I load it to my Irrlicht app, it looks very "2D" red shape. Is it possible to make it look like as it in 3ds max?
3D models without texture
-
- Posts: 1215
- Joined: Tue Jan 09, 2007 7:03 pm
- Location: Leuven, Belgium
Re: 3D models without texture
I think 3ds max has a directional light set up with gouraud shading applied as the default shading method and a pretty strong ambient light so the faces which aren't affected by the directional light don't get too darkxiaOK wrote:I created a simple red cube without texture in 3ds max, and exported to 3ds.
When I load it to my Irrlicht app, it looks very "2D" red shape. Is it possible to make it look like as it in 3ds max?
Re: 3D models without texture
Thanks! But, how can set the shading method in Irrlicht? I can't find any tutorial.Radikalizm wrote:I think 3ds max has a directional light set up with gouraud shading applied as the default shading method and a pretty strong ambient light so the faces which aren't affected by the directional light don't get too darkxiaOK wrote:I created a simple red cube without texture in 3ds max, and exported to 3ds.
When I load it to my Irrlicht app, it looks very "2D" red shape. Is it possible to make it look like as it in 3ds max?
-
- Posts: 1215
- Joined: Tue Jan 09, 2007 7:03 pm
- Location: Leuven, Belgium
-
- Posts: 41
- Joined: Tue Nov 16, 2010 4:57 pm
- Location: /home/yaten on a server somewhere East of Asia
- Contact:
Hi Sir xiaOK, I prepared a small demo which loads a very basic 3ds file for your convenience. It is actually derived from the very first example (01.HelloWorld), I just trimmed it down and added lighting.
Source code with .3ds file and .max
source and assets
Screenshot:
I hope that can help ^_^
Source code with .3ds file and .max
source and assets
Code: Select all
#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, "Irrlicht.lib")
#pragma comment(linker, "/subsystem:windows /ENTRY:mainCRTStartup")
#endif
int main()
{
IrrlichtDevice *device =
createDevice( video::EDT_OPENGL, dimension2d<u32>(640, 480), 16,
false, false, false, 0);
if (!device) return 1;
device->setWindowCaption(L"Load 3ds");
IVideoDriver* driver = device->getVideoDriver();
ISceneManager* smgr = device->getSceneManager();
IAnimatedMesh* mesh = smgr->getMesh("Assets/native_box.3ds");
if (!mesh)
{
device->drop();
return 1;
}
IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode( mesh );
ILightSceneNode* light0 = smgr->addLightSceneNode(
0, // parent node
core::vector3df(-10, 40, -20), // position
video::SColorf( 1.0f, 0.0f, 0.0f), // color
30.0f, // radius
1 ); // id
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();
driver->endScene();
}
device->drop();
return 0;
}
I hope that can help ^_^