Hi, I’m new to Panda, 3d and Python! I’ve been doing research for most of the day, having grown discontent with VB, .NET, C and C++. So far it looks exactly like what me and my potential team need to get a minor social game we want to make going.
One problem though I’ve found with the tutorials: every single one which is supposed to track a player object (the room tutorial IPknight made, as well as the final BVW demo) requires the same fix of changing the cNode to cNodePath for the addCollider call.
Unfortunately, this breaks the camera tracking and the camera starts slowly sliding off into infinity. I’ve looked around and haven’t been able to find a fix for this anywhere, and since I’m still learning it’s a bit hard to figure out on my own.
Any help would be greatly appreciated.
I don’t think the NodePath change is related to the problem you are describing. Tell me more about the camera sliding off to infinity. What does this mean? What exactly appears to be happening? Does it happen in all of the demos?
Well, it happens with none of the samples in 1.1.0 but I don’t think any of those actually have the camera tracking the object.
But in IPKnightly’s second tutorial I have the same problem as the before last poster has. The camera here tracks the player actor, or is supposed to. I haven’t tried it in 1.0.5 (since I’m only starting now I’d rather get used to 1.1.0 rather than have to convert everything back later) but it seems to definately be a problem by the cNode -> cNodePath change for adding colliders.
It also happens in BVW’s demo, the final demonstration (bvwdemo_final.py) is the only part of the samples that (as stated in its readme) is coded to track the panda, instead of the camera simply remaining at one point in space and rotating to look at it.
Again I haven’t been able to try it in 1.0.5 but I have to assume it worked when it was written. To get the py file to work though, you have to change a collider from a node to a path, and as soon as it works and the camera starts the move it basically starts sliding away from the actor (the panda in this case) and won’t stop.
I’m afraid I really can’t be more specific without like a few weeks to get very familiar with Panda3D and Python. Since Panda3D doesn’t have any bundled samples of camera tracking on actors I was trying to get these to work so I’d have sample code I could learn from once I got to that point.
I know I’m apparantly not the only one who gets this problem though, as illustrated by the poster in the thread linked above.
Ah, I see what is happening. Actually, this is a very subtle bug that we recently found and fixed in the Panda3D codebase (but not soon enough to keep it out of the 1.1.0 release). This is a bug deep in the program that generates the Python/C++ interface code. The nature of the bug is that a VBase3() minus a Point3() will produce the wrong result–but other combinations, like Point3() - Point3(), or VBase3() - VBase3(), or Point3() - VBase3(), all work correctly.
The fix will be in the next official release of Panda, but in the meantime you can work around it by changing a line like this:
direction = Vec3( desiredPos - currPos )
direction = Point3(desiredPos) - currPos
I apologize for the bug, and for the confusion it caused.
Thanks very much for looking into it, especially so quickly. I’ll definately be looking out for the next release!