New lighting model WIP

 From:  vodkamartini
2801.86 In reply to 2801.85 
Gotcha. I like the variety of options you're planning, and it sounds like you're trying to make it more user friendly than Rhino's vector + diffuse + spec inputs.




In terms of a scripting interface, my first thought would have been to just accept an array of light objects that you can loop through. So javascript-wise the above rhino settings might look something like:

lights = [];
lights[0] = {
    direction: {x: 1, y: 0.8, z: -0.5},
    color: {r: 214, g: 214, b: 214},
    spec: {r: 146, g: 146, b: 146}
};
lights[1] = {
    direction: {x: -1, y: -0.5, z: 0},
    color: {r: 0, g: 0, b: 0},
    spec: {r: 115, g: 115, b: 115}
};
lights[2] = {
    direction: {x: -1, y: -0.8, z: 0.5},
    color: {r: 100, g: 100, b: 100},
    spec: {r: 0, g: 0, b: 0}
};
moi.lightingEngine.setLights(lights);


Of course your lights might have different properties than Rhino's depending on the types you allow (point, directional, spot, etc). Anyway, it's not a big deal in the end. I was just tossing out an idea since you were working in that area.
Attachments: