Re: Problims with light
Posted by Tomasz on Nov 21, 2010; 4:35pm
URL: https://forum.jogamp.org/Problims-with-light-tp1824171p1940790.html
ok I think that I've resolved my problim last and current setings.
float no_mat[] = { 0.0f, 0.0f, 0.0f, 0.0f };//materiał
float mat_ambient[] = { 0.7f, 0.7f, 0.7f, 0.8f };
float mat_ambient_color[] = { 0.8f, 0.8f, 0.2f, 1.0f };
float mat_diffuse[] = { 0.3f, 0.5f,0.0f, 1.0f };
float mat_specular[] = { 1.0f, 1.0f, 1.0f, 1.0f };
float no_shininess[] = { 0.0f };
float low_shininess[] = { 5.0f };
float high_shininess[] = { 75.0f };
float mat_emission[] = { 0.3f, 0.2f, 0.2f, 0.3f };//światło
float ambient[] = { 1.0f, 1.0f, 1.0f, 0.8f };
float diffuse[] = { 1.0f, 1.0f, 1.0f, 1.0f };
float specular[] = { 1.0f, 1.0f, 1.0f, 1.0f };
float position[] = { 70.0f, 6.0f, -25.5f, 0.5f };
float lmodel_ambient[] = { 0.4f, 0.4f, 0.4f, 1.0f };
float local_view[] = { 0.3f };
float green[] = { 0.5f, 0.2f, 0.4f, 0.0f};//kolor osi
float red[] = { 0.7f, 0.0f, 0.0f, 0.5f};
//światło
gl.glLightfv(GL.GL_LIGHT0, GL.GL_AMBIENT, ambient, 0);
gl.glLightfv(GL.GL_LIGHT0, GL.GL_DIFFUSE, diffuse, 0);
gl.glLightfv(GL.GL_LIGHT0, GL.GL_SPECULAR,specular, 0);
gl.glLightfv(GL.GL_LIGHT0, GL.GL_POSITION, position, 0);
gl.glLightModelfv(GL.GL_LIGHT_MODEL_AMBIENT, lmodel_ambient, 0);
gl.glLightModelfv(GL.GL_LIGHT_MODEL_COLOR_CONTROL, local_view, 0);
gl.glEnable(GL.GL_LIGHT0);
gl.glEnable(GL.GL_LIGHTING);
and fills ok with me
Another question sorry that in one post:
how to make the light in one place eaven when I'm turning arround the scene( i know thees are the basics) but I don't have freas mind I know that I should push and pop matriks someware or add angles correction somwhere