Вниз
Скачать: CL | DM;

Динамическое создание объектов в glscene   Найти похожие ветки 

← →
Goldseeker   (2004-12-24 21:01) [0]

почему этот код не работает, причем дает ошибку лишь при повторном нажатии кнопки:
procedure TForm1.Button1Click(Sender: TObject);
begin
setlength(sphere,length(sphere)+1);
sphere[length(sphere)]:=msphere(gldummycube1.AddNewChild(msphere)) ;
sphere[length(sphere)].Position.x:=random(2);
sphere[length(sphere)].Position.y:=random(2);
sphere[length(sphere)].Position.z:=random(2);
end;
sphere - динамический массив msphere
msphere - класс потомок tglsphere


← →
kerby   (2004-12-27 09:39) [1]

паскальчик учить надо

переменные:
sphere:array of tglsphere;
count:integer;

инициализация:
count:=0;
setlength(sphere,count);

обработчик:
inc(count);

SetLength(sphere,count);
sphere[count-1]:=TGLSphere(GLDummyCube1.AddNewChild(TGLSphere));
      ^^^^^^^^
with sphere[count-1] do
           ^^^^^^^^
begin
Position.SetPoint(random(5),random(5),random(5));
end;



Страницы: 1 вся ветка

Скачать: CL | DM;



Память: 0.45 MB
Время: 0.024 c
4-1107873140
Fessio
2005-02-08 17:32
2005.03.20
Как узнать имя компьютера и его описание в WINXP?


14-1109507481
SMT
2005-02-27 15:31
2005.03.20
Перевод звукового формата DVD в формат MPEG3


1-1110127325
Nes
2005-03-06 19:42
2005.03.20
Неактивное как активное =)


14-1109824602
begin...end
2005-03-03 07:36
2005.03.20
С Днём рождения! 3 марта


1-1110191808
dDan
2005-03-07 13:36
2005.03.20
RegExp




   Наверх