Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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.

share|improve this question
    
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. –  Sidar Oct 10 '12 at 12:51

1 Answer 1

up vote 2 down vote accepted

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.