This content has been marked as final. Show 5 replies
You can attach any node to any other node in the scene graph. A node can be a model, a group, a camera or a light. Use the addChild() method with the #preserveWorld parameter. By the way, you can attach the light to the model in 3DS Max, saving you the hassle of the code.
-- car stuff
theCar = member("w3dmember").node("carNode")
carPos = theCar.getWorldTransform().position
-- light stuff
theLight = member("w3dmember").light("theLight")
theLight.getWorldTransform().position = carPos
-- make light child of car
you'll now need to point the light at the ground, don't know what state everything was in befroe adding light, but rotating it shoudl work,
Thanks for the help, guys. I am trying to make it so you can click on a car to get details about it and the selected car has a glowing circle under it (that follows the terrain below). I want to be able to do it dynamically.
I tried adding a spot light in 3ds Max and put it exactly where I wanted and how I wanted it to look, but when I exported it to director, it isn't right. I tried rotating, and everything. I just can't seem to the the light UNDER my model and to shine down into a small circle on the ground. Any ideas?
In that case, I would fake it.
I would use a plane textured with an alpha channel bitmap of a round with a transparent feather effect (for the glow). I would set the emissive color of the shader for this round to rgb(255,255,255) to light it. Then, I would just set the visibility of this plane object to #both / #none when I want to display / discard it.
You can create the bitmap in Firefox by creating a Shape, then clicking + to add the glow then select the transparent color for the background (in the Properties at the bottom). Then save as PNG (default).
I meant Fireworks, not Firefox ;-)