Вниз
Скачать: 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.44 MB
Время: -0.975 c
1-1109932176
AngelOKES
2005-03-04 13:29
2005.03.20
Нужен алгоритм работы с огромными числами (до 200 десятичных зна)


1-1109945501
andrey__
2005-03-04 17:11
2005.03.20
TDBGrid - свойство FixedCols


10-1086094163
Tormoz
2004-06-01 16:49
2005.03.20
Диапазон ячеек в Excel


3-1108733737
awod
2005-02-18 16:35
2005.03.20
Вопрос по отъеданию памяти Access-ом


1-1109952072
webpauk
2005-03-04 19:01
2005.03.20
Указатели




   Наверх