Tutorial 2 and 7 help

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.
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

Ahh, your camera was inside the node... ;)

Well, you don't really need a light...
You can set the lightning off with this line:

Code: Select all

node->setMaterialFlag(EMF_LIGHTING, false);
so you don't need a light, and be sure all texture are in the same folder as the mesh...

For the irrEdit file, how did you try to load it ???
There is a special function for this: smgr->loadScene(...) (look at the api for more informations on this, there is also a tutorial for this)

I think you didn't finish all tutorials, did you ???
You first should work through all tuts before trying to modify them... ;)
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
Azert
Posts: 18
Joined: Sun Feb 18, 2007 11:34 am
Location: Belgium

Post by Azert »

Again a noob question where do I need to put that line?, I tried beneath "node->setPosition(core::vector3df(0,0,0));" but it doens't compile.

About the .irr file I indeed didn't use that function (tutorial 15).
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

It's not important where to use this line, the only rule is "after you created the node" (with addOctTreeSceneNode or addAnimatedMeshSceneNode)...

What's your compiler tell you what went wrong (error log in console window) ???
In future you should post such information, too... ;)
Otherwise we can only guess what happened...

I think it's because you don't use the namespaces for this so the line in complete (with no namespace usings) would be:

Code: Select all

node->setMaterialFlag(irr::video::EMF_LIGHTING, false);
You can avoid this by using the namespaces, right after the includings:

Code: Select all

#include <Irrlicht.h>
using namespace irr;
using namespace video;
Then you can use it like I told you in the other post... ;)
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
Azert
Posts: 18
Joined: Sun Feb 18, 2007 11:34 am
Location: Belgium

Post by Azert »

Line works fine now, and I got light, wich reveals a new issue: the level is transparant... :?

I don't see anything in the code that could make it transparant (and if there was some line: the quake map should be also transparant wich is not...), and I also checked the normals and textures.
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

Hmmm, strange...
Maybe you created the mesh with transparency (I don't think so) ???
What texture file format do you use, maybe one with alpha channel/blending ???
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
Azert
Posts: 18
Joined: Sun Feb 18, 2007 11:34 am
Location: Belgium

Post by Azert »

The texture is a TGA one (a default land texture from Morrowind, not that that matters), I've also placed the texture in the same directory.

It's not that they're completly transparant: I can see the textures of the wall behind the wall I currently look at.
Azert
Posts: 18
Joined: Sun Feb 18, 2007 11:34 am
Location: Belgium

Post by Azert »

I think I found the problem, it's the TGA texture, so I should take some other texture files.
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

yes, TGA have alpha blending... ;)
but you can also edit the textures and set their alpha channel (transparency)...
or you can try to set the material of the node explicide to solid...
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
Azert
Posts: 18
Joined: Sun Feb 18, 2007 11:34 am
Location: Belgium

Post by Azert »

I tried also some other texture formats and all the results are the same: transparant (even with the ones from Irrlicht).

So how do you set them to solid?
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

try:

Code: Select all

node->setMaterialType(EMT_SOLID);
but this should be default...
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
Azert
Posts: 18
Joined: Sun Feb 18, 2007 11:34 am
Location: Belgium

Post by Azert »

Thanks all works fine now :)
Post Reply