Welcome Guest [Log In] [Register]
We hope you enjoy your visit.


You're currently viewing the Ultimate 3D Community as a guest. This means that you can only read posts, but can not create posts or topics by yourself. To be able to post you need to register. Then you can participate in the community active and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.

Join our community!

If you are already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
How to set bone positions?
Topic Started: Oct 19 2008, 11:08 PM (224 Views)
abacus
Member Avatar
Elite Member
[ *  *  *  * ]
I am trying to make it so that the arms on my character can go up and down with the mouse. to do this I use this code:


if keyboard_check_direct(vk_shift)=1
{
first_frame=48; //first frame of the idle animation (if any, else put 1)
last_frame=50; //last frame of the idle animation (if any, else put 1)
frame=49;
roty=camera.direction+90
walking=0
leftarm=GetBoneIndex(bone02);
rightarm=GetBoneIndex(bone03);
SetBoneRotation(leftarm, 0,-73+camera.rotatex,0);
SetBoneRotation(rightarm,0,87+camera.roatatex,0);
Step()
exit;
}


The model goes into it's aiming frame (arms up and stuff) correctly if I just have this:

if keyboard_check_direct(vk_shift)=1
{
first_frame=48; //first frame of the idle animation (if any, else put 1)
last_frame=50; //last frame of the idle animation (if any, else put 1)
frame=49;
roty=camera.direction+90
walking=0

Step()
exit;
}


But with the

leftarm=GetBoneIndex(bone02);
rightarm=GetBoneIndex(bone03);
SetBoneRotation(leftarm, 0,-73+camera.rotatex,0);
SetBoneRotation(rightarm,0,87+camera.rotatex,0);

bit, the model walks and aims sideways, and the arms do not move up and down. Instead, when you move the mouse up and down, the entire model turns sideways. Bone02 and bone03 are both actually the shoulder-bones, but they control the arms. I think that they actually ARE turning, they are just not turning their child bones. How do I make them turn the child bones as well? I do not want to have to model every frame of up/down aiming, that would be a pain.
Offline Profile Quote Post Goto Top
 
skarik
Member Avatar
kitten eating scum
[ *  *  *  *  *  * ]
What's your model format? It matters.

For example, .X files put a prefix on all exported bones.


Though, your description of the problem reminds me of my problem (which I figured out was a .X exporter problem with the checkboxes). It looks funny after a good night's rest, doesn't it?
Edited by skarik, Oct 20 2008, 12:50 AM.
Blog|EHS
Offline Profile Quote Post Goto Top
 
abacus
Member Avatar
Elite Member
[ *  *  *  * ]
I am using anim8or. (.an8 files)
Edited by abacus, Oct 21 2008, 12:03 PM.
Offline Profile Quote Post Goto Top
 
ZetaBoards - Free Forum Hosting
Create a free forum in seconds.
Learn More · Sign-up for Free
« Previous Topic · Questions about Ultimate 3D · Next Topic »
Add Reply