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 Studio Chat / Fixing Object To Bone Rotation

Author
Message
MateiSoft
11
Years of Service
User Offline
Joined: 22nd Oct 2012
Location:
Posted: 27th May 2020 10:59
Hi guys,

I want to rotate a weapon that is attached to the character's hand bone, to face with the bullet barrel in front of the camera.
However, I am doing a guessing game that is not giving me any good values for rotating the gun properly.
I use fixobjecttobone and before this I use setobjectrotation.

Is there any proper math for this procedure?

Thank you very much for your help!
www.alexmatei.com
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 27th May 2020 21:51
MateiSoft
11
Years of Service
User Offline
Joined: 22nd Oct 2012
Location:
Posted: 28th May 2020 12:38 Edited at: 28th May 2020 16:52
Tried it now, the weapon is still in a wrong angle. I tried adding additional coordinates to setobjectlookat, but still can't find the right coordinates and although it reaches 175 degrees to some axis, it stops and then rotates in the opposite way...
www.alexmatei.com
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 28th May 2020 22:23
The weapon must be aligned down the z-axis
MateiSoft
11
Years of Service
User Offline
Joined: 22nd Oct 2012
Location:
Posted: 29th May 2020 08:32
Before fixing it to the bone and setobjectlookat?
www.alexmatei.com
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 29th May 2020 09:06
Yes.
MateiSoft
11
Years of Service
User Offline
Joined: 22nd Oct 2012
Location:
Posted: 29th May 2020 10:08
I think it's better to give my code. I am sure that there is something wrong here:



And in the main loop:

www.alexmatei.com
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 29th May 2020 22:30
MateiSoft
11
Years of Service
User Offline
Joined: 22nd Oct 2012
Location:
Posted: 30th May 2020 12:19
Sadly not working still, but if we do this:



It's a much easier guessing game.
www.alexmatei.com

Login to post a reply

Server time is: 2024-04-20 01:14:29
Your offset time is: 2024-04-20 01:14:29