ellioman

Creature: Transform a bone's localposition to world position

Recommended Posts

Hey everybody,

I need a little help with using the Creature game object from Kestrel Moon Studios.

What I've got so far:

My html page: http://ellioman.games/test/c/
The code: https://gist.github.com/ellioman/e508aacd4f07028645aa126bc5474d06

What I'm trying to do:

Get the bunny sprite (that you see in the top left corner) to follow a bone I've retrieved from the creature object. I use the "bone.getWorldStartPt()" function in Creature to get the position of the bone but the problem is that the position I get is the character’s world space (local-position).

I therefore somehow need to inverse the transformation of the position gotten from getWorldStartPt() so I that have the world position that will be used to position my bunny texture.

Does anyone know how I can accomplish this?

Cheers,
Elvar

 

 

Share this post


Link to post
Share on other sites

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.