gouraud shading display of a stl file

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
stephaneR
Posts: 12
Joined: Fri Mar 28, 2008 9:10 pm

gouraud shading display of a stl file

Post by stephaneR »

Hi,

i'm trying to load and display stl files in a modified sample.
i'm using the SVN version as I want to benefit the VBOs.
I have a problem with the material, I cannot find a way to display the stl model in gouraud shading, as I will have no textures associated with the models.
All I have a a full black model (or white)

Is that possible to use materials without textures with an imported STL file ?
if yes, how ?

thanks,

Stephane
Gianni
Posts: 48
Joined: Sat Mar 22, 2008 9:24 am

Post by Gianni »

I think you should put this line

Code: Select all

node->setMaterialFlag(video::EMF_LIGHTING, false);
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

You'll have to recalculate the normals smoothed to get smooth lighting effects. Otherwise you will get per-face normals, and hence only flat shading.
Post Reply