light noob question

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
saulotmalo
Posts: 54
Joined: Wed Oct 04, 2006 6:56 am

light noob question

Post by saulotmalo »

there is a easy way to setup a light that ligthen all the scene in a uniform way?
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

I think you want an ambiente light ???
Use setAmbientLight(...) (have a look at the API for more infos) !!!
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
saulotmalo
Posts: 54
Joined: Wed Oct 04, 2006 6:56 am

Post by saulotmalo »

i've tried the ambient light but i don't see any change :(
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

did you set your nodes to Lighting = true ???
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
saulotmalo
Posts: 54
Joined: Wed Oct 04, 2006 6:56 am

Post by saulotmalo »

of course, but i'm thinking that i'm having a problem with the mesh that i'm using, can i send it to yo and you try it?
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

Hmm, it could be that the normals are not correct, but I don't know if this also affects ambiente light...

Of course you can send me your mesh for testing !!! ;)
BTW, what 3d editor you're using ???
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

how about trying to place your light stuff in irredit so you can have some realtime feedback? :wink:
Then all you gotta do, once things look as you want them to, is save as a .irr file and load it.
saulotmalo
Posts: 54
Joined: Wed Oct 04, 2006 6:56 am

Post by saulotmalo »

yes, i tried it, and i cant see the texture in irredit, could this be the problem? also i've upload the mesh that does don't see good if you cant sugest me some 3d editing software ( actually I'm using 3d Studio ) or can make me a litle tutorial of how to solve the problem. For my game I only need simple objects like smooth cubes or something like that.

http://www.megaupload.com/?d=3AE8K0TB

EDIT: also i did put the gold material properties to the model in irrlith and it still sees bad :(
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

Now I did not test the models, yet...
I will test them tomorrow... ;)
But I had a look with MilkShape3D ad they look fine with it...
I exported them to .x format !!!
Try them now, perhaps they're working now ???

http://abusoft.g0dsoft.com/models.zip
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
saulotmalo
Posts: 54
Joined: Wed Oct 04, 2006 6:56 am

Post by saulotmalo »

i've tried it, now it works a much better, now i see the model as if it where gouraud shaded instead of flatshaded, but it loaded the mesh a litle moved to z position... can it be helped? or can I use 3ds and save somehow??.

THANKS!!!!! :D
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

Well, there are some DX exporters for 3dsm avilable...
But it seems they are not really easy to handle (many posts in the forum about this)...

About the position offset:
no the position is not shifted !!!
it's because I forgot one thing when I converted the meshes:
3dsm uses an other coordinate system, so the meshes are rotated at the origins !!!
Unfortunately this is hard to see if the meshes are symetric !!!
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

I just had a look at the coordinate systems... ;)
You'll have to rotate the meshes about -90° on the X-axis !!!

Code: Select all

node->setRotation(vector3df(-90, 0, 0));
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
saulotmalo
Posts: 54
Joined: Wed Oct 04, 2006 6:56 am

Post by saulotmalo »

thanks i'll try this night this after dinner if works i'll put the Solved at the top of the thread.
Post Reply