GRASS GIS 7 Programmer's Manual  7.5.svn(2017)-r71933
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
lights.c File Reference

Nviz library – Change lighting settings. More...

#include <grass/glocale.h>
#include <grass/nviz.h>
Include dependency graph for lights.c:

Go to the source code of this file.

Functions

int Nviz_set_light_position (nv_data *data, int num, double x, double y, double z, double w)
 Set light position. More...
 
int Nviz_set_light_bright (nv_data *data, int num, double value)
 Set light brightness. More...
 
int Nviz_set_light_color (nv_data *data, int num, int red, int green, int blue)
 Set light color. More...
 
int Nviz_set_light_ambient (nv_data *data, int num, double value)
 Set light ambient. More...
 
int Nviz_init_light (nv_data *data, int num)
 Init new light. More...
 
int Nviz_new_light (nv_data *data)
 Define new light. More...
 
void Nviz_draw_model (nv_data *data)
 Draw lighting model. More...
 

Detailed Description

Nviz library – Change lighting settings.

Based on visualization/nviz/src/lights.c

(C) 2008, 2010 by the GRASS Development Team This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details.

Author
Updated/modified by Martin Landa <landa.martin gmail.com> (Google SoC 2008/2010)

Definition in file lights.c.

Function Documentation

void Nviz_draw_model ( nv_data data)

Draw lighting model.

Parameters
datanviz data

Definition at line 185 of file lights.c.

References GS_done_draw(), GS_draw_lighting_model(), GS_ready_draw(), GS_set_draw(), GSD_BACK, and GSD_FRONT.

int Nviz_init_light ( nv_data data,
int  num 
)

Init new light.

Parameters
datanviz data
numlight num (starts at 1)

Definition at line 133 of file lights.c.

References light_data::ab, light_data::ag, light_data::ar, light_data::b, light_data::brt, light_data::g, G_debug(), light_data::id, nv_data::light, MAX_LIGHTS, num, light_data::r, light_data::w, light_data::x, light_data::y, and light_data::z.

Referenced by Nviz_new_light().

int Nviz_new_light ( nv_data data)

Define new light.

Parameters
datanviz data
Returns
1 on success
0 on failure

Definition at line 164 of file lights.c.

References _, G_warning(), GS_new_light(), num, and Nviz_init_light().

Referenced by Nviz_init_data().

int Nviz_set_light_ambient ( nv_data data,
int  num,
double  value 
)

Set light ambient.

Parameters
datanviz data
numlight num (starts at 1)
valueambient value (same for R/G/B) (0-1)

Definition at line 114 of file lights.c.

References light_data::ab, light_data::ag, light_data::ar, G_debug(), GS_setlight_ambient(), nv_data::light, and num.

Referenced by Nviz_init_view().

int Nviz_set_light_bright ( nv_data data,
int  num,
double  value 
)

Set light brightness.

Parameters
datanviz data
numlight num (starts at 1)
valuebrightness value

Definition at line 63 of file lights.c.

References b, light_data::b, light_data::brt, g, light_data::g, G_debug(), GS_setlight_color(), nv_data::light, num, r, and light_data::r.

Referenced by Nviz_init_view().

int Nviz_set_light_color ( nv_data data,
int  num,
int  red,
int  green,
int  blue 
)

Set light color.

Parameters
datanviz data
numlight num (starts at 1)
red,green,blueRGB values (0-255)

Definition at line 87 of file lights.c.

References b, light_data::b, light_data::brt, g, light_data::g, G_debug(), GS_setlight_color(), nv_data::light, num, r, and light_data::r.

Referenced by Nviz_init_view().

int Nviz_set_light_position ( nv_data data,
int  num,
double  x,
double  y,
double  z,
double  w 
)

Set light position.

Parameters
datanviz data
numlight num (starts at 1)
x,y,z,wposition, model coordinates
Returns
1

Definition at line 27 of file lights.c.

References G_debug(), GS_setlight_position(), light_data::id, nv_data::light, num, light_data::w, x, light_data::x, light_data::y, and light_data::z.

Referenced by Nviz_init_view().