Grozz

[HELP] Getting a Ped's Bone Matrix

Recommended Posts

I need a function that calculates ped's bone matrices. (bone_attach functions doesn't work)
I'm working on a shader that actually can move a ped's bone.

Share this post


Link to post

You will find more explanation on element 4x4 matrix here: https://wiki.multitheftauto.com/wiki/GetElementMatrix

First 3 rows require: right, up, forward vectors. Fourth will be position. You can provide right and forward, and up will be cross product of the two.

You can also create matrix provided 3 points in 3d space. And that is essentially what bone_attach does. The code is fairly easy to understand:

hint: getMatrixFromPoints function in bone_pos_rot.lua

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.