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 / Glue object to limb - Rotation problems

Author
Message
TheDuke
19
Years of Service
User Offline
Joined: 28th Feb 2007
Location: Denmark
Posted: 6th Jan 2011 08:26
Originally posted here:
http://forum.thegamecreators.com/?m=forum_view&t=179775&b=22
But no one seemed to be able to answer this on the DarkGDK forums so i translated the code and posted it here.
I might have gotten some things wrong at the translation but i hope it's readable
Soo i have problems applying the rotation properly after i glue an object to a limb, i made some code where i basically cut off a limb and then reapply it to the model. Using the ninja model from the DarkMatter.

I attached an image of the outcome. Clearly i have to rotate the object in some way. Maybe something like i do with the Position Object. As the rotation becomes relative to the limb. However i did this:


And they all returned 0.
Sven B
21
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 6th Jan 2011 08:59 Edited at: 6th Jan 2011 09:05
I would suggest trying
Limb Direction X/Y/Z()
to rotate your object.

It returns (or at least should return) the global angles of the limb.

[edit] It seems that glue object to limb should control position as well as rotation and scaling... I have no idea in that case. Does the sword object moves when you animated the ninja?
Because if it's just a fixed error, then you could use rotate limb on limb 0 of the sword until it looks right.

Cheers!
Sven B

TheDuke
19
Years of Service
User Offline
Joined: 28th Feb 2007
Location: Denmark
Posted: 6th Jan 2011 10:46
Well i can adjust the rotation manually. But i wanted to do it programtically. So i can make a dynamic class of it that can be used for several instances.. But i guess sometimes there is no easy way other than make a specialized model where i know where the limb is pointing to.
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 6th Jan 2011 10:51
I have a function which glues two objects together based on where they both are in world space using EZ rotate if that's any use:


Login to post a reply

Server time is: 2026-07-18 23:14:45
Your offset time is: 2026-07-18 23:14:45