Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Object becomes to black

Author
Message
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 23rd Sep 2013 15:49
Do someone know why on earth objects made by triangles becomes completly black when we rotate the object, with ambient light 0

I try converting object fvf but can't get any solution



I'm not a grumpy grandpa
Sasuke
20
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 23rd Sep 2013 16:37 Edited at: 23rd Sep 2013 16:40
Well thinking about it I'd imagine this would be due to incorrect normals on the objects. Also the object isn't visible from the top and it looks like it's reversed so the front face is on the bottom. I had to:

X Rotate - the object so it was facing upright so it would be affected by lights correctly then...
Set Object Normals - which corrected the light levels on the object

Amended code:


I'm not that knowledgeable when it comes to meshes and how normals work. But I'm thinking, would manually flipping the normals correct this issue?

"Get in the Van!" - Van B
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 23rd Sep 2013 16:53
it works !!!

@Sasuke so easy !!! I feel myself like a stupid
Thanks so much

I'm not a grumpy grandpa
Sasuke
20
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 23rd Sep 2013 16:57
Quote: "@Sasuke so easy !!! I feel myself like a stupid"


Haha thanks and this happens to me all the time I guess we programmer really have to remember a lot and sometimes the small things just slip our memory, well it does for me

"Get in the Van!" - Van B
Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 23rd Sep 2013 17:29
Doesn't ambient light 0 turn off ambient light, making everything dark anyway?

Sasuke
20
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 23rd Sep 2013 17:40
I believe ambient light only controls illumination of objects but it's still affected by lights.

"Get in the Van!" - Van B
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 23rd Sep 2013 17:46
Quote: "Doesn't ambient light 0 turn off ambient light, making everything dark anyway?"


Sasuke is right...we can set ambient light 0 and hide light 0 and use another light, for example a torch that the player takes, when we are into places with no light at all.

Cheers.

I'm not a grumpy grandpa

Login to post a reply

Server time is: 2026-07-07 01:54:44
Your offset time is: 2026-07-07 01:54:44