"LookAt Offset"

I’ve got a little problem, as you might have already guessed.
I use the LookAt method, to tell my camera to look at a panda. However, the camera looks at the position of the camera. Okay, no problem. But I want it to look at the face of the panda.

How do I do that?


lookAt() accepts more parameters than just a nodepath. you can directly add an x,y,z offset relative to the nodepath.like
dunno the exact values for looking at the face.

if you have tkinter installed you can
load a “smiley.egg” , reparent it to the panda, and call smiley.place() on it. then move the smiley to the face of the panda, write down the values you get and use those as offset in the lookAt function.
alternatively you can try to guess and experiment with the values until it matches.

Thank you, that’s the camcode I’m using right now:


hmm… is it normal, that the values are THIS big?

I’m using a scaled panda(0.005,0.005,0.005) and a scaled environment(0.25,0.25,0.25) like in the Manual. But in the Manual, they are using quite low values…


When you scale the model, its space (or its local coordinate system) is scaled too. So, if your panda is scaled with 0.005, it means that 1 unit in Panda’s local coordinates is 1*0.005=0.005 actual “global” units. This is why your values are so big.
Generally, you want to avoid reparenting something to scaled models since it can be confusing. It’s better to reparent both panda and camera to some unscaled root node, and move/rotate this node instead of moving/rotating panda itself.

Nah, it’s fine with me. Thank you^^ Just wanted to know the reason ;D


and yes, the panda model is really huge