|
Author |
Topic: lights(); (Read 2524 times) |
|
mannytan
|
lights();
« on: Dec 10th, 2002, 6:01am » |
|
would it be easy to set the background color of a lightsource? the default color is black and it looks a little awkward against, say a white background.
|
|
|
|
REAS
|
Re: lights();
« Reply #1 on: Dec 10th, 2002, 1:02pm » |
|
The light and camera functionality are a separate small project in themselves, and (to be honest) they are not one of our top priorities. We are looking for someone who might want to build this part of the Proce55ing.
|
|
|
|
fry
|
Re: lights();
« Reply #2 on: Dec 10th, 2002, 9:10pm » |
|
the api for the lighting isn't exposed, and is ugly. if you're excited about lighting, and aren't afraid of your code breaking in the future, you can play with the lights directly. technical description: lights are a list of items inside the graphics object. there are ten of them, the first 2 (index 0 and 1) are already in use and provide ambient and diffuse lighting for the scene. the ambient light is shut off by default, the diffuse one is white light that comes from the eye position. if you wanted to add a third light, you'd use: Code:// you can mess with [2] through [9] // values for kind are AMBIENT, DIFFUSE, and DISABLED g.lightKind[2] = DIFFUSE; // set position of the light to (1.0, 2.0, 1.5) g.lightX[2] = 1.0; g.lightY[2] = 2.0; g.lightZ[2] = 1.5; // set the color of this light to something odd // numbers always between 0..1 g.lightR[2] = 1.0; g.lightG[2] = 0.5; g.lightB[2] = 0.8; |
| that should (though is not guaranteed) to work. this will change in the future, but since lighting is a ways down the todo list, you may as well goof around with it for the time being.
|
|
|
|
|