NAME

glEvalMesh1, glEvalMesh2 - compute a one- or two-dimensional grid of points or lines

C SPECIFICATION

void ggllEEvvaallMMeesshh11( GLenum _m_o_d_e,
                  GLint _i_1,
                  GLint _i_2 )

delim $$

PARAMETERS

_m_o_d_e
In ggllEEvvaallMMeesshh11, specifies whether to compute a one-dimensional mesh of points or lines. Symbolic constants GGLL__PPOOIINNTT and GGLL__LLIINNEE are accepted.
_i_1, _i_2
Specify the first and last integer values for grid domain variable $i$.

C SPECIFICATION

void ggllEEvvaallMMeesshh22( GLenum _m_o_d_e,
                  GLint _i_1,
                  GLint _i_2,
                  GLint _j_1,
                  GLint _j_2 )

PARAMETERS

_m_o_d_e
In ggllEEvvaallMMeesshh22, specifies whether to compute a two-dimensional mesh of points, lines, or polygons. Symbolic constants GGLL__PPOOIINNTT, GGLL__LLIINNEE, and GGLL__FFIILLLL are accepted.
_i_1, _i_2
Specify the first and last integer values for grid domain variable $i$.
_j_1, _j_2
Specify the first and last integer values for grid domain variable $j$.

DESCRIPTION

ggllMMaappGGrriidd and ggllEEvvaallMMeesshh are used in tandem to efficiently generate and evaluate a series of evenly-spaced map domain values. ggllEEvvaallMMeesshh steps through the integer domain of a one- or two-dimensional grid, whose range is the domain of the evaluation maps specified by ggllMMaapp11 and ggllMMaapp22. _m_o_d_e determines whether the resulting vertices are connected as points, lines, or filled polygons.

In the one-dimensional case, ggllEEvvaallMMeesshh11, the mesh is generated as if the following code fragment were executed:


glBegin( _t_y_p_e _)_; _f_o_r _( _i _= _i_1_; _i _<_= _i_2_; _i _+_= _1 _) _g_l_E_v_a_l_C_o_o_r_d_1_( _i_$_^_c_d_o_t_^_D_E_L_T_A _u _~_+_~ _u _s_u_b _1_$ _)_; _g_l_E_n_d_(_)_; _w_h_e_r_e _<_b_r_>_<_b_r_> _$ _D_E_L_T_A _u _~_=_~ _(_u _s_u_b _2 _~_-_~ _u _s_u_b _1 _) _^_/_^ _n_$ _<_b_r_>_<_b_r_> _<_/_d_l_> _<_p_> _a_n_d _$_n_$_, _$_u _s_u_b _1_$_, _a_n_d _$_u _s_u_b _2_$ _a_r_e _t_h_e _a_r_g_u_m_e_n_t_s _t_o _t_h_e _m_o_s_t _r_e_c_e_n_t ggllMMaappGGrriidd11 _c_o_m_m_a_n_d_. _t_y_p_e _i_s GGLL__PPOOIINNTTSS _i_f _m_o_d_e _i_s GGLL__PPOOIINNTT_, _o_r GGLL__LLIINNEESS _i_f _m_o_d_e _i_s GGLL__LLIINNEE_. _<_p_> _T_h_e _o_n_e _a_b_s_o_l_u_t_e _n_u_m_e_r_i_c _r_e_q_u_i_r_e_m_e_n_t _i_s _t_h_a_t _i_f _$_i _~_=_~ _n_$_, _t_h_e_n _t_h_e _v_a_l_u_e _c_o_m_p_u_t_e_d _f_r_o_m _$ _i_^_c_d_o_t_^_D_E_L_T_A _u _~_+_~ _u _s_u_b _1_$ _i_s _e_x_a_c_t_l_y _$_u _s_u_b _2_$_. _<_p_> _I_n _t_h_e _t_w_o_-_d_i_m_e_n_s_i_o_n_a_l _c_a_s_e_, ggllEEvvaallMMeesshh22_, _l_e_t _<_b_r_> _<_p_r_e_> _<_/_p_r_e_> _<_d_l _c_o_m_p_a_c_t_> _<_d_t_> _<_b_>_<_/_b_> _$ _D_E_L_T_A _u _~_=_~ _m_a_r_k _( _u _s_u_b _2 _~_-_~ _u _s_u_b _1 _) _^_/_^ _n_$ _<_d_d_> _<_b_r_>_<_b_r_> _$ _D_E_L_T_A _v _~_=_~ _l_i_n_e_u_p _( _v _s_u_b _2 _~_-_~ _v _s_u_b _1 _) _^_/_^ _m_$_, _<_/_d_l_> _<_p_> _w_h_e_r_e _$_n_$_, _$_u _s_u_b _1_$_, _$_u _s_u_b _2_$_, _$_m_$_, _$_v _s_u_b _1_$_, _a_n_d _$_v _s_u_b _2_$ _a_r_e _t_h_e _a_r_g_u_m_e_n_t_s _t_o _t_h_e _m_o_s_t _r_e_c_e_n_t ggllMMaappGGrriidd22 _c_o_m_m_a_n_d_. _T_h_e_n_, _i_f _m_o_d_e _i_s GGLL__FFIILLLL_, _t_h_e ggllEEvvaallMMeesshh22 _c_o_m_m_a_n_d _i_s _e_q_u_i_v_a_l_e_n_t _t_o_: _<_b_r_> _<_p_r_e_> _<_/_p_r_e_> _<_d_l _c_o_m_p_a_c_t_> _<_d_t_> _<_b_>_<_/_b_> _<_d_d_> _f_o_r _( _j _= _j_1_; _j _< _j_2_; _j _+_= _1 _) _{ _g_l_B_e_g_i_n_( _G_L___Q_U_A_D___S_T_R_I_P _)_; _f_o_r _( _i _= _i_1_; _i _<_= _i_2_; _i _+_= _1 _) _{ _g_l_E_v_a_l_C_o_o_r_d_2_( _i_$_^_c_d_o_t_^_D_E_L_T_A _u _~_+_~ _u _s_u_b _1_$_, _j_$_^_c_d_o_t_^_D_E_L_T_A _v _~_+_~ _v _s_u_b _1_$ _)_; _g_l_E_v_a_l_C_o_o_r_d_2_( _i_$_^_c_d_o_t_^_D_E_L_T_A _u _~_+_~ _u _s_u_b _1_$_, _(_j_+_1_)_$_^_c_d_o_t_^_D_E_L_T_A _v _~_+_~ _v _s_u_b _1_$ _)_; _} _g_l_E_n_d_(_)_; _} _<_/_d_l_> _<_p_> _I_f _m_o_d_e _i_s GGLL__LLIINNEE_, _t_h_e_n _a _c_a_l_l _t_o ggllEEvvaallMMeesshh22 _i_s _e_q_u_i_v_a_l_e_n_t _t_o_: _<_b_r_> _<_p_r_e_> _<_/_p_r_e_> _<_d_l _c_o_m_p_a_c_t_> _<_d_t_> _<_b_>_<_/_b_> _<_d_d_> _f_o_r _( _j _= _j_1_; _j _<_= _j_2_; _j _+_= _1 _) _{ _g_l_B_e_g_i_n_( _G_L___L_I_N_E___S_T_R_I_P _)_; _f_o_r _( _i _= _i_1_; _i _<_= _i_2_; _i _+_= _1 _) _g_l_E_v_a_l_C_o_o_r_d_2_( _i_$_^_c_d_o_t_^_D_E_L_T_A _u _~_+_~ _u _s_u_b _1_$_, _j_$_^_c_d_o_t_^_D_E_L_T_A _v _~_+_~ _v _s_u_b _1_$ _)_; _g_l_E_n_d_(_)_; _} _<_b_r_>_<_b_r_> _f_o_r _( _i _= _i_1_; _i _<_= _i_2_; _i _+_= _1 _) _{ _g_l_B_e_g_i_n_( _G_L___L_I_N_E___S_T_R_I_P _)_; _f_o_r _( _j _= _j_1_; _j _<_= _j_1_; _j _+_= _1 _) _g_l_E_v_a_l_C_o_o_r_d_2_( _i_$_^_c_d_o_t_^_D_E_L_T_A _u _~_+_~ _u _s_u_b _1_$_, _j_$_^_c_d_o_t_^_D_E_L_T_A _v _~_+_~ _v _s_u_b _1 _$ _)_; _g_l_E_n_d_(_)_; _} _<_/_d_l_> _<_p_> _A_n_d _f_i_n_a_l_l_y_, _i_f _m_o_d_e _i_s GGLL__PPOOIINNTT_, _t_h_e_n _a _c_a_l_l _t_o ggllEEvvaallMMeesshh22 _i_s _e_q_u_i_v_a_l_e_n_t _t_o_: _<_b_r_> _<_p_r_e_> _<_/_p_r_e_> _<_d_l _c_o_m_p_a_c_t_> _<_d_t_> _<_b_>_<_/_b_> _<_d_d_> _g_l_B_e_g_i_n_( _G_L___P_O_I_N_T_S _)_; _f_o_r _( _j _= _j_1_; _j _<_= _j_2_; _j _+_= _1 _) _f_o_r _( _i _= _i_1_; _i _<_= _i_2_; _i _+_= _1 _) _g_l_E_v_a_l_C_o_o_r_d_2_( _i_$_^_c_d_o_t_^_D_E_L_T_A _u _~_+_~ _u _s_u_b _1_$_, _j_$_^_c_d_o_t_^_D_E_L_T_A _v _~_+_~ _v _s_u_b _1_$ _)_; _g_l_E_n_d_(_)_; _<_/_d_l_> _<_p_> _I_n _a_l_l _t_h_r_e_e _c_a_s_e_s_, _t_h_e _o_n_l_y _a_b_s_o_l_u_t_e _n_u_m_e_r_i_c _r_e_q_u_i_r_e_m_e_n_t_s _a_r_e _t_h_a_t _i_f _$_i_~_=_~_n_$_, _t_h_e_n _t_h_e _v_a_l_u_e _c_o_m_p_u_t_e_d _f_r_o_m _$_i_^_c_d_o_t_^_D_E_L_T_A _u _~_+_~ _u _s_u_b _1_$ _i_s _e_x_a_c_t_l_y _$_u _s_u_b _2_$_, _a_n_d _i_f _$_j_~_=_~_m_$_, _t_h_e_n _t_h_e _v_a_l_u_e _c_o_m_p_u_t_e_d _f_r_o_m _$_j _^_c_d_o_t_^ _D_E_L_T_A _v _~_+_~ _v _s_u_b _1_$ _i_s _e_x_a_c_t_l_y _$_v _s_u_b _2_$_. _<_h_3 _i_d_=_"_E_R_R_O_R_S_"_> _E_R_R_O_R_S _<_/_h_3_> GGLL__IINNVVAALLIIDD__EENNUUMM _i_s _g_e_n_e_r_a_t_e_d _i_f _m_o_d_e _i_s _n_o_t _a_n _a_c_c_e_p_t_e_d _v_a_l_u_e_. _<_p_> GGLL__IINNVVAALLIIDD__OOPPEERRAATTIIOONN _i_s _g_e_n_e_r_a_t_e_d _i_f ggllEEvvaallMMeesshh _i_s _e_x_e_c_u_t_e_d _b_e_t_w_e_e_n _t_h_e _e_x_e_c_u_t_i_o_n _o_f ggllBBeeggiinn _a_n_d _t_h_e _c_o_r_r_e_s_p_o_n_d_i_n_g _e_x_e_c_u_t_i_o_n _o_f ggllEEnndd_. _<_h_3 _i_d_=_"_A_S_S_O_C_I_A_T_E_D _G_E_T_S_"_> _A_S_S_O_C_I_A_T_E_D _G_E_T_S _<_/_h_3_> ggllGGeett _w_i_t_h _a_r_g_u_m_e_n_t GGLL__MMAAPP11__GGRRIIDD__DDOOMMAAIINN _<_b_r_> ggllGGeett _w_i_t_h _a_r_g_u_m_e_n_t GGLL__MMAAPP22__GGRRIIDD__DDOOMMAAIINN _<_b_r_> ggllGGeett _w_i_t_h _a_r_g_u_m_e_n_t GGLL__MMAAPP11__GGRRIIDD__SSEEGGMMEENNTTSS _<_b_r_> ggllGGeett _w_i_t_h _a_r_g_u_m_e_n_t GGLL__MMAAPP22__GGRRIIDD__SSEEGGMMEENNTTSS _<_h_3 _i_d_=_"_S_E_E _A_L_S_O_"_> _S_E_E _A_L_S_O _<_/_h_3_> ggllBBeeggiinn((33GG))_, ggllEEvvaallCCoooorrdd((33GG))_, ggllEEvvaallPPooiinntt((33GG))_, ggllMMaapp11((33GG))_, ggllMMaapp22((33GG))_, ggllMMaappGGrriidd((33GG)) _<_/_b_o_d_y_> _<_/_h_t_m_l_>