PPP
This commit is contained in:
16
src/main.c
Normal file → Executable file
16
src/main.c
Normal file → Executable file
@@ -29,15 +29,17 @@ void calc_normal(float* v1, float* v2, float* v3, float* normal)
|
||||
|
||||
void fill_normal( float * d, float * n )
|
||||
{
|
||||
*n = *d;
|
||||
//*n = *d;
|
||||
for (int i = 0; i < *d; i += 9)
|
||||
{
|
||||
|
||||
vec3 norm_vec;
|
||||
calc_normal((d+1)+i, (d+1)+i+3, (d+1)+i+6, norm_vec);
|
||||
glm_vec3_copy( norm_vec, (n+1)+i );
|
||||
glm_vec3_copy( norm_vec, (n+1)+i+3 );
|
||||
glm_vec3_copy( norm_vec, (n+1)+i+6 );
|
||||
glm_vec3_copy( norm_vec, (n+1)+i );
|
||||
glm_vec3_copy( norm_vec, (n+1)+i+3 );
|
||||
glm_vec3_copy( norm_vec, (n+1)+i+6 );
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,15 +59,15 @@ int main( void )
|
||||
|
||||
glewInit();
|
||||
|
||||
|
||||
fill_normal( d_cube, n_cube );
|
||||
fill_normal( d_cube, d_cube+(int)*d_cube);
|
||||
|
||||
if( !( shader = create_shader() ) )
|
||||
goto error_shader;
|
||||
|
||||
gload_program( shader, vs, VERTEX );
|
||||
gload_program( shader, fs, FRAGMENT );
|
||||
use_shader( shader );
|
||||
use_shader( shader );
|
||||
|
||||
|
||||
load_fix_matrix( shader, (float)WIDTH/HEIGHT );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user