ArsThaumaturgis/Panda3DTutorial.io

Lesson 3 miss few imports

Closed this issue · 2 comments

Seems like part 3 of your lesson miss few imports (since the only import added in this chapter was from panda3d.core import AmbientLight), which make code non-functional:

  • For ambient light part - panda returns NameError: name 'Vec4' is not defined. It may be solved by rather adding from panda3d.core import Vec4 to imports, or removing Vec4, so related line will look like that: ambientLight.setColor((0.2, 0.2, 0.2, 1)).

  • For directional light part - error is NameError: name 'DirectionalLight' is not defined, and its solved by adding this into imports: from panda3d.core import DirectionalLight.

Ah, you're quite right! That is indeed an oversight on my part, I believe, and my apologies that I missed it!

(For what it's worth, the reference code includes all of the required imports, I believe.)

Right, that should be fixed in 58837f6!