no dobra udalo sie, ale mam problm ze swiatlem .<ort>niewiem</ort> jak zrobic aby cztery swiala padaly z czterech stron i zeby szescian obracajac sie zmienial kolory z czterych stron tak jak na swiatlo pada .w specular (to chyba od kolorów ) probuje ustawic zeby byl czarny,czerwony a on mi wyswietla tylko bialy (zajamuje prawe caly szescian) niebieski nieraz zulty i dosc czesto zielony.
oto moj kod na swiatlo
procedure tform1.swiatlo;
const
amb: tglarrayf4 =(50.0,60.0,20.0,1.0);
dif: tglarrayf4 =(0.0,0.6,56.0,1.0);
emis:tglarrayf4 = (30.0,0.9,9.0,1.0);
pos3: tglarrayf4 =(150.4,150.7,-200.6,1.0);
pos2: tglarrayf4 =(-150.4,150.7,200.6,1.0);
pos1: tglarrayf4 =(-150.4,-200.7,-200.6,1.0);
pos: tglarrayf4 =(150.4,-150.7,-100.6,1.0);
spec3: tglarrayf4 =(0.0,60.0,5.0,1.0);
spec2: tglarrayf4 =(0.4,56.7,0.6,1.0);
spec1: tglarrayf4 =(255.4,0.7,0.6,1.0);
spec :tglarrayf4 =(0.0,6.0,34.0,1.0);
begin
gllightmodelfv(gl_light_model_ambient,@amb);
gllightfv(gl_light1,gl_specular,@spec);
gllightfv(gl_light1,gl_position,@pos);
glenable(gl_light1);
gllightfv(gl_light0,gl_specular,@spec1);
gllightfv(gl_light0,gl_diffuse,@dif);
gllightfv(gl_light0,gl_position,@pos1);
glenable(gl_light0);
gllightfv(gl_light2,gl_specular,@spec2);
gllightfv(gl_light2,gl_ambient,@amb);
gllightfv(gl_light2,gl_position,@pos2);
glenable(gl_light2);
gllightfv(gl_light3,gl_specular,@spec3);
gllightfv(gl_light3,gl_emission,@emis);
gllightfv(gl_light3,gl_position,@pos3);
glenable(gl_light3);
end;
procedure TForm1.GLSetupRC(Sender: TObject);
const
amb:tglarrayf4=(1.6,0.2,0.8,1.2);
pos:tglarrayf4=(0.6,0.2,2.8,1.0);
spec:tglarrayf4=(2.2,0.5,3.1,1.0);
emis:tglarrayf4=(0.6,3.2,0.8,1.7);
dif:tglarrayf4=(2.6,1.2,0.3,1.0);
begin
glclearcolor(0,0,0,1);
glenable(gl_depth_test);
glenable(gl_lighting);
glEnable(GL_COLOR_MATERIAL);
glEnable(GL_NORMALIZE);
rozmiar;
glmaterialfv(gl_front_and_back,gl_ambient_and_diffuse,@amb);
glmaterialf(gl_back,gl_shininess,80);
glmaterialfv(gl_front_and_back,gl_emission,@emis);
glmaterialfv(gl_front_and_back,gl_specular,@spec);
glmaterialfv(gl_front_and_back,gl_position,@pos);
end;
aaa
jak jeszcze by mi wytlumaczyli co znacza takie polecenia
glpopmatrix
glpushmatrix
glenable(gl_normlize)
gllightmodelfv(gl_light_model_ambient,@amb)
glmaterialfv(gl_front_and_back,gl_position,@pos)
glmteriafv to z ktorej strony bedzie padaly kolory bo jezeli jest z sprzodu i z tylu ale, nie bedzie z bokuw ,czemu i ktore strony szescianu mi pokryje bo w tej bieli za bardzo nie widze .raz tam mi sie udalo zrobic zeby bylo na zielono ,niebiesko i zulto ale jak chcialem zrobic czerwony to sie zrobily wszystkie boki biale</ort>