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.

AppGameKit Classic Chat / Problems with LoadObjectWithChildren()

Author
Message
JohnStabler
AGK Bronze Backer
10
Years of Service
User Offline
Joined: 16th Aug 2013
Location: Cardiff, Wales, UK
Posted: 20th Dec 2015 16:30
I'm running in to problems loading a .X file (attached)

1. If I load it with LoadObjectWithChildren() then not all of the model is visible. The character's arms and staff are missing. It appears to load fully in Blender.
2. If I use SetObjectScale() with the model it doesn't actually scale but instead messes up the model and animation. It looks like a blob having a fit.
3. If I use SetObjectScalePermanent() then it appears to scale correctly and the animation works BUT my hit detection is broken. The hit object seems to be offset to the left.

And, an extra noob question:

4. How do I apply textures to the model? Anyone got some sample code?

Thanks in advance!

Attachments

Login to view attachments
Stab in the Dark software
Valued Member
21
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 20th Dec 2015 18:06 Edited at: 22nd Dec 2015 00:06
The problem your having is that there is a 40 bone limit in AGK. Your model has 56 bones.
AGK ignores bones over 40, if the ignored bones have vertices assigned to them it will cause the
the model to be deformed. I have altered your model in a program called Fragmotion and have attached it.
I removed some bones which had no vertices assigned to them and removed others and reassigned the vertices.
I was able to get the bone count down to 41. If you compare the 2 models in blender you will see the difference.

Textures need to be applied in AppGameKit like so.
LoadImage(1,"Mage_Texture.png")
setobjectimage(1,1,0)
The coffee is lovely dark and deep,and I have code to write before I sleep.

Attachments

Login to view attachments
JohnStabler
AGK Bronze Backer
10
Years of Service
User Offline
Joined: 16th Aug 2013
Location: Cardiff, Wales, UK
Posted: 21st Dec 2015 16:11
Thanks for your work on the model. It looks a lot better now. However, I'm still having issues with hit detection when casting rays.

Login to post a reply

Server time is: 2024-05-02 06:23:04
Your offset time is: 2024-05-02 06:23:04