Quantcast
Channel: Cocos Forums - Latest topics
Viewing all articles
Browse latest Browse all 17093

Need Bone / Mesh / Skeleton Position

$
0
0

@ariemeow wrote:

I Have a 3D Model, and have an animation (c3t) file too.
In the animation, the model is not at (0,0,0), but (0,0,-300). And in the animation, the model have a lot of move (my game genre is 3DFighting Game).

Sprite3D* mummy = Sprite3D::create("mummy.c3t");
Animation3D* idle = Animation3D::create("mummy_anim.c3t","MasRig1|idle");
Animate3D* idleAnimate = Animate3D::create(idle);
mummy->runAction(idleAnimate);

I need my camera to always focus on my character, but when i do mummy-getPosition3D() is always give me an initial position. How to get my character position when animation running? I can get the bone, mesh, or skeleton. but i can't get any position from it.

void FightingScene::update(float dt){
    if(focusToPlayer){
        auto sprite = battleClass->getPlayer(); // it returns the mummy sprite
        lookAtFocus = ???? // i need to get the mummy position here

camera->lookAt(lookAtFocus);
    }
}

Thanks :slight_smile:

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 17093

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>