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.

Dark GDK / SetObjectNormals issue with bones

Author
Message
Zehydra
15
Years of Service
User Offline
Joined: 27th Jan 2009
Location: Wherever \"here\" is.
Posted: 27th Jul 2011 22:08
Here's my problem. When I load my bone-rigged .x model into Dark GDK normally, I get a model that works perfectly fine animation wise. However, the model itself is a bit dark and seems to be completely unaffected by lights, except for ambient light.

One solution to this problem that I have found is by using the "dbSetObjectNormals()" command, which then magically gives my model light. This is the only command that does this.

Puzzlingly though, it creates a whole new problem. It affects the model itself and its bones. It flips it sideways, compresses the model's overall size, and changes the bones' overall strength, so all of the limbs move back and forth way too much.

For 3d Modeling I use Caligari's Truespace, which has worked like a charm for me in the past (when I used Dark Basic Pro). For whatever reason, I was able to turn on lighting for objects just by using "dbSetNormalizationOn()", which no longer has the same effect in Dark GDK.

The only way I can get the "dbSetObjectNormals" command to work without affecting the integrity of the model is to remove all bones from the .x file during export. Though this of course means that I have no animation now for my character.

The code itself is somewhat lengthy, so I will provide small sections if need be.

~I am Zehydra~
Morcilla
21
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 28th Jul 2011 19:49
Sounds like you are exporting the model without normals.

dbSetObjectNormals just re-builds the normals of a mesh (or builds them if they do not exist) and sets them to 1.0 in lenght. Shouldn't be used unless needed.

dbSetNormalizationOn affects all the objects and ensures that normals scale accordingly with each object scale. Most programs perform this once when initializing.

So for what you say, maybe you are not exporting normals, or perhaps they are too tiny to light the object. Make sure that normals are exporting and that they are 1.0 in lenght (at least).
Just an idea, hope it helps.

Zehydra
15
Years of Service
User Offline
Joined: 27th Jan 2009
Location: Wherever \"here\" is.
Posted: 29th Jul 2011 08:56
Thanks for the tip. Unfortunately I'm not really sure if the program (Truespace 7) is actually exporting the normals as it should. There is a checkbox in the export window for it labeled, "Normals", but checking/unchecking it seems to make no difference.

What's odd, and I think I forgot to mention this, is that DBPRO handles it fine. I only need to call the "Set Normalization On" command in DBPRO to get the lighting to behave normally. DarkGDK however, doesn't work the same way, in one way or another.

~I am Zehydra~

Login to post a reply

Server time is: 2024-05-23 20:21:14
Your offset time is: 2024-05-23 20:21:14