1
\$\begingroup\$

Total noob to Maya. Total noob to Panda3D. Planning on becoming really good at both as soon as I have free time to do so, but right now I have an assignment due in a few hours which requires this:

(The part which confuses me is bolded.)

  • Model and texture a vehicle and two different obstacles
  • Build a scene graph in Panda with a plane, the vehicle, several copies of each of the obstacles, and (at least) a direction light

  • Program vehicle movement, constrained to a plane (no terrain)

  • Working headlights

  • Vehicle collides with obstacles

How do I attach a light source to a model? I'm assuming this is done in Panda3D but I'm sufficiently new to this that I wouldn't be astonished to hear it's part of the model.

\$\endgroup\$
1
  • \$\begingroup\$ Don't you add a light node with the panda framework? You don't exactly need to attach it to your model. All I know is that Maya does not export light. I think it does however export the nodes. But your best bet is to use code. panda3d.org/manual/index.php/Lighting Python button is in top. \$\endgroup\$
    – Sidar
    Commented Oct 10, 2012 at 12:51

1 Answer 1

1
\$\begingroup\$

In Panda3D, a light is represented by a node in the scene graph, just as a geometry node represents a geometry mesh. A light source is typically attached under a specific node in the scene graph (in your case, under a node representing the vehicle, so that the light moves with the vehicle). Then, the light is explicitly enabled on the nodes that it needs to illuminate (usually render, to illuminate everything), using render.setLight(yourLight).

Since the .egg format presently does not support lights, it is not currently possible to export lights from Maya to Panda3D through the .egg format. You will need to create the light objects in Panda3D and attach them to your vehicle node in the code.

It is however possible to create an empty node in Maya to indicate where the light should be positioned, and then extract the position of that particular node in Panda3D, so that you don't need to hardcode the specific coordinates that the headlights should be positioned at.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .