Loading mesh from .obj

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.
tobix10
Posts: 15
Joined: Thu Feb 26, 2015 5:34 pm

Re: Loading mesh from .obj

Post by tobix10 »

Hey, I have another strange problem - 5 of 6 sides are illuminated, but ceiling is not ;/. Normals are good and the light source is just below ceiling. I was able to see texture, but it was dimmed. In mtl all materials have the same properties.
My way around is to give EmissiveColor, but I don't understend why only one side is not working ;/.

Code: Select all

# Blender MTL File: 'room.blend'
# Material Count: 3
 
newmtl Material.001
Ns 96.078431
Ka 1.000000 1.000000 1.000000
Kd 0.640000 0.640000 0.640000
Ks 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 1
map_Kd wood.jpeg
 
newmtl Material.002
Ns 96.078431
Ka 1.000000 1.000000 1.000000
Kd 0.640000 0.640000 0.640000
Ks 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 1
map_Kd wall.jpg
 
newmtl Material.003
Ns 96.078431
Ka 1.000000 1.000000 1.000000
Kd 0.640000 0.640000 0.640000
Ks 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 1
map_Kd ceiling.png
 
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Loading mesh from .obj

Post by CuteAlien »

As before - we again need the model. There's nothing I can debug without having a test-case.
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
tobix10
Posts: 15
Joined: Thu Feb 26, 2015 5:34 pm

Re: Loading mesh from .obj

Post by tobix10 »

CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Loading mesh from .obj

Post by CuteAlien »

Depending on what you want either front-/backfaces are flipped or normals are wrong. Do you want to be inside or outside of this box? The normals point inside, but the vertex order is putting the textures on the outside.
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
tobix10
Posts: 15
Joined: Thu Feb 26, 2015 5:34 pm

Re: Loading mesh from .obj

Post by tobix10 »

CuteAlien wrote:but the vertex order is putting the textures on the outside.
All of them or just the ceiling? Can I change this in blender?

I want to be inside box. It's a simple room.
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Loading mesh from .obj

Post by CuteAlien »

Will have to figure that out myself first (no idea why I haven't run into this problem yet). I'm still a beginner myself when it comes to Blender. I try it in the evening.
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
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Loading mesh from .obj

Post by CuteAlien »

Export your obj file with z forward (instead of -z forward). Which doesn't really make sense to me right now as Irrlicht to my knowledge internally converts from right handed obj files to it's left handed format. But seems to work...
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
Post Reply