15 #include <grass/glocale.h>
16 #include <grass/nviz.h>
28 double x,
double y,
double z,
double w)
44 data->light[
num].x = x;
45 data->light[
num].y =
y;
46 data->light[
num].z = z;
47 data->light[
num].w =
w;
49 G_debug(1,
"Nviz_set_light_position(): num = %d x = %f y = %f z = %f w = %f",
69 r = data->light[
num].r * data->light[
num].brt;
70 g = data->light[
num].g * data->light[
num].brt;
71 b = data->light[
num].b * data->light[
num].brt;
73 G_debug(1,
"Nviz_set_light_bright(): num = %d value = %f r = %f g = %f b = %f",
88 int red,
int green,
int blue)
92 data->light[
num].r = red / 255.;
93 data->light[
num].g = green / 255.;
94 data->light[
num].b = blue / 255.;
96 r = data->light[
num].r * data->light[
num].brt;
97 g = data->light[
num].g * data->light[
num].brt;
98 b = data->light[
num].b * data->light[
num].brt;
100 G_debug(1,
"Nviz_set_light_color(): num = %d r = %d/%f g = %d/%f b = %d/%f",
101 num, red, r, green, g, blue, b);
120 G_debug(1,
"Nviz_set_light_ambient(): num = %d value = %f",
135 G_debug(1,
"Nviz_init_light(): num = %d", num);
136 if (num > MAX_LIGHTS) {
140 data->light[
num].id = 0;
141 data->light[
num].brt = 0.8;
142 data->light[
num].ar = 0.3;
143 data->light[
num].ag = 0.3;
144 data->light[
num].ab = 0.3;
145 data->light[
num].r = 1.0;
146 data->light[
num].b = 1.0;
147 data->light[
num].g = 1.0;
148 data->light[
num].x = 1.0;
149 data->light[
num].y = 1.0;
150 data->light[
num].z = 1.0;
151 data->light[
num].w = 1.0;
171 G_warning(_(
"Unable to define new light"));
void GS_setlight_ambient(int num, float red, float green, float blue)
Set light ambient.
void Nviz_draw_model(nv_data *data)
Draw lighting model.
void GS_setlight_color(int num, float red, float green, float blue)
Set light color.
void GS_done_draw(void)
Draw done, swap buffers.
int Nviz_init_light(nv_data *data, int num)
Init new light.
int Nviz_set_light_color(nv_data *data, int num, int red, int green, int blue)
Set light color.
int Nviz_set_light_bright(nv_data *data, int num, double value)
Set light brightness.
int Nviz_set_light_ambient(nv_data *data, int num, double value)
Set light ambient.
G_warning("category support for [%s] in mapset [%s] %s", name, mapset, type)
int Nviz_set_light_position(nv_data *data, int num, double x, double y, double z, double w)
Set light position.
int G_debug(int level, const char *msg,...)
Print debugging message.
int GS_new_light(void)
Add new model light.
int Nviz_new_light(nv_data *data)
Define new light.
void GS_set_draw(int where)
Sets which buffer to draw to.
void GS_setlight_position(int num, float xpos, float ypos, float zpos, int local)
Set light position.
void GS_draw_lighting_model(void)
Draw lighting model.