Ralph neck looking at a model

I found a problem of making ralph model looking at a model but I solved it

https://discourse.panda3d.org/viewtopic.php?p=50015&sid=cfe3d885e613401c848b8be6759caac5

My problem now is to make ralph head itself rotate correctly to the model using the lookAt()
http://www.mediafire.com/i/?zrhemonmdwu
I found a member who asked before about it

https://discourse.panda3d.org/viewtopic.php?t=7818&sid=494507e91b9ab415d9cee67e99b8f00e

but no one get a final solution for it and also none of these solution suited me
anyone have another idea??

Making a particular joint of a model rotate to look at something is tricky, and may require the model having been created to make it possible (that is, without any unusual counter-rotations in the neck).

There is an example called “Looking and gripping” that illustrates rotating Eve’s neck so that her head follows the mouse.

David

Yeah…I studied this tutorial but it not used lookAt() function,it just used eveNeck.setH() and eveNeck.setP()
and this are not so accurate if the the character itself (eve) moves in different directions so the looking to the mouse will not be right
lookAt() is more accurate but only if you can adjust it in right way
any other ideas?

The answer I quoted in the linked thread may still apply; it refers to solving the problem of rotating the top of the head instead of the face.

As I’m not sure precisely which problem you’re having, I’m not sure how to provide more specific advice.

David

the problem is figuring out if ralph has the capability of turning his head in the first place

edit: sorry my mistake, ralph should have the capability to turn his head since he has a neck joint which allows him to bob his head up and down